emacs-libvterm icon indicating copy to clipboard operation
emacs-libvterm copied to clipboard

Preserve view and cursor of vterm buffer

Open ChoppinBlockParty opened this issue 2 years ago • 4 comments

I have some command running and producing output in a vterm buffer. If I try to stop following the end of the output and keep looking at some position above the end - I cannot do it. The cursor and buffer view get continuously moved to the end.

Related problem, If a command finished running and I have a some output, and I have positioned the cursor and the view at some location above the end. Then mov to another buffer and open minibuffer below, vterm position gets reset to the end of the buffer.

I find very important to have the location in the shell where I am looking now preserved. Is this possible in vterm?

ChoppinBlockParty avatar Jan 10 '23 13:01 ChoppinBlockParty

I sympathize with the frustration. This has to do with the fact that the vterm window is redrawn extremely often, and every time the window is redrawn, the state of the terminal is validated, which moves the cursor to the input line.

I once tried finding a way around this, and I would like to find it. I think that at the moment your best bet is to use vterm-copy-mode when you want to preserve the position of the point.

Sbozzolo avatar Jan 10 '23 14:01 Sbozzolo

I am learning to use copy-mode. I have a question what happens if you have a process running and potentially printing output and copy-mode get enabled? Do I lose output? Does the process get suspended?

ChoppinBlockParty avatar Jan 20 '23 16:01 ChoppinBlockParty

The process keeps running and the output will appear once you leave copy-mode.

Sbozzolo avatar Jan 20 '23 16:01 Sbozzolo

Discovered that process will get blocked if the piped do not get read.

ChoppinBlockParty avatar Mar 22 '23 15:03 ChoppinBlockParty