terminator
terminator copied to clipboard
Scroll to last executed command
Sometimes when I run commands that output a lot, I find it difficult to scroll to the top of that output and find where in the scroll back I executed the last command. Is there a way of jumping to the scrollback line where the last command was executed?
Unfortunately, the terminal itself has no way of differentiating a prompt from any other text that is on the terminal. Terminal and iterm2 on OSX have a way of marking prompts, and then being able to jump to the previous mark. This is a neat feature that I just discovered, and, oddly enough, I don't think any other linux terminal is able to do this. There may be a technical reason for this, but I may also poke around the iterm2 source code to see if I can code up something similar.
One hack to achieve this would be to do Ctrl-Shift-f and search for your prompt, and this will find your last prompt.
Even just a feature where it can move the scroll bar back to the line you were at when you last pressed Enter would do the trick. I'd thought about the Ctrl-Shift-f option but was really looking for a single keypress option.
Following prompts will only work when there is some kind of marker. Remembering the scroll position might be tricky...
See also https://bugzilla.gnome.org/show_bug.cgi?id=767230.
VTE 0.76 will support this, with the hardcoded Shift+Ctrl+Left/Right keys, using the quasi-standard OSC 133 escape sequences (the prompt is set up in vte.sh to emit these).
However, Terminator hijacks the Shift+Ctrl+Left/Right (and also Up/Down) keypresses, so this functionality (as well as scrolling by lines) is not available.
Ideally VTE should make these shortcuts configurable, but I'm not sure it's going to happen any time soon. Maybe Terminator should reconsider its own shortcuts. Until then, users can reconfigure Terminator's ones in its settings.
I just switched to kitty terminal instead