这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@iamahuman
Copy link
Contributor

@iamahuman iamahuman commented Dec 20, 2018

You may change mScreen.clearTranscript(); to mMainBuffer.clearTranscript(); if you think it should clear the scrollback even in alternate screen mode.

Since there seems to be no consensus of the semantics of scrollback clear commands among terminal emulators I was not sure which one to implement. But hey, better to have something than nothing ;)

Resolves #933.

@iamahuman
Copy link
Contributor Author

(WIP)

@ghost
Copy link

ghost commented Dec 28, 2018

(WIP)

Is work still in progress ?

Your current changes doesn't work with command reset. However tput E3 and printf "\e[3J" are working.

@iamahuman
Copy link
Contributor Author

iamahuman commented Dec 28, 2018

@xeffyr I'm very surprised to find that it actually did work, since the code wasn't tested because I was coding it in Termux itself(!) and didn't look thoroughly throughout the code for verification. Meanwhile it needs additional fixes to the com.termux.view.TerminalView.onScreenUpdated() method, specifically it should update the mTopRow field accordingly when mActiveTranscriptRows value decreases back to 0.

About the reset part, I thought about it but I'm not sure if it's the best since although libvte-based terminal emulators does seem to also clear scrollback for the reset sequence, it's not entirely universal and macOS' Terminal.App doesn't. Still, I'll look into it once @fornwall becomes active here again.

@fornwall
Copy link
Member

I think supporting CSI 3 J would be nice!

Could you look at the necessary changes to onScreenUpdated(), and also perhaps adding a test to ControlSequenceIntroducerTest?

@iamahuman iamahuman force-pushed the csi3j branch 4 times, most recently from 19d2e27 to 9a7a843 Compare January 25, 2019 02:56
@iamahuman
Copy link
Contributor Author

@fornwall Fixed and rebased on 7f4df83 .

@fornwall fornwall merged commit 2a36b91 into termux:master Feb 5, 2019
@fornwall
Copy link
Member

fornwall commented Feb 5, 2019

Thanks! This will be part of the next release (v0.67) which will be made shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support of <ESC>[3J to clear scrollback

2 participants