Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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)


iTerm 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.


If I understood you right, some terminal emulators support this:

https://codeberg.org/dnkl/foot#jumping-between-prompts


Try 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.


Are you asking about something different than up-arrow or the 'history' command?


Yes, 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


That 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.


I 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... hmm - seems like the more searchable term is "prompt jumping"


You mean like tmux or screen? EDIT: apparently not, sorry.


VSCode terminal also does this I believe.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: