5 ms·
I would love a feature to scroll back to previous input lines, I don't think I ever found something that supports it (I haven't spent a lot of time searching fo
by dv_dt 2y ago
I would love a feature to scroll back to previous input lines, I don't think I ever found something that supports it (I haven't spent a lot of time searching for it admittedly)
- jandrese 2y agoAre you asking about something different than up-arrow or the 'history' command?
- dv_dt 2y agoYes, say you start a command that outputs a long buffer of lines, and you want to go back to the early part of that output, even better if you could jump back multiple scroll buffer points
- jandrese 2y agoThat is generally the responsibility of the terminal, not the shell. If your terminal doesn't have a scrollbar try hitting "scroll lock" and then moving up and down with page up/page down. Some really dumb terminals have no scrollback, but most modern ones do.
- dv_dt 2y agoI may be misunderstanding, I'm not talking about just the scrollback buffer (I don't think?), I want to not hunt for the line in the buffer and instead jump to the line of the last input command in the buffer. The "jumping between prompts" mentioned in the other comment is more or less that feature - but it seems for that implementation you need to customize the prompt with a special sequence and have an emulator that supports jumping to that seq. I wonder if something like tmux would do it w/o customization... oh maybe https://unix.stackexchange.com/questions/226731/jump-to-last-prompt-in-terminal-or-tmux https://unix.stackexchange.com/questions/226731/jump-to-last... hmm - seems like the more searchable term is "prompt jumping"
- c-st 2y agoIf I understood you right, some terminal emulators support this: https://codeberg.org/dnkl/foot#jumping-between-prompts https://codeberg.org/dnkl/foot#jumping-between-prompts
- atombender 2y agoiTerm on macOS does this. It calls them "marks", and you can set them anywhere, but by default it creates a mark for each prompt. You can then jump between them with cmd-arrow. iTerm also suppers showing the timestamp of each line, and it visualizes this in a nice way where lines emitted around the same time have their timestamps replaced with a vertical line.
- ku1ik 2y agoVSCode terminal also does this I believe.
- cobbaut 2y agoYou mean like tmux or screen? EDIT: apparently not, sorry.
- xp84 2y agoTry the Warp terminal app. That’s what I use and it does this. Its other main deal (to me) is that you can use the mouse and any other normal means to edit a command line. Really good for changing something on like line 1 of a 17-line curl command.