wez / wezterm

A GPU-accelerated cross-platform terminal emulator and multiplexer written by @wez and implemented in Rust
https://wezfurlong.org/wezterm/
Other
16.36k stars 726 forks source link

Support for iTerm2 marks #2666

Open swsnr opened 1 year ago

swsnr commented 1 year ago

Is your feature request related to a problem? Please describe. iTerm2 has this handy feature which lets you place a "mark" in arbitrary output with OSC 1337 ; SetMark ST. For every mark it puts a small indicator onto the left border, and let's you scroll back to past marks with Cmd+Shift+M.

Back when I used macOS and iTerm I had my prompt emit a mark, so I could scroll back to the previous prompt with a single hotkey. I found this handy in cases where I accidentally dumped too much text onto a terminal, and wanted to see the first lines.

Describe the solution you'd like I'd love to have this escape code, and with all the recent changes to wayland support Wezterm has become so great that I figured I could ask for the last piece to perfection 😇

Describe alternatives you've considered Are there any other ways to mark shell prompts and scroll back to past prompts?

Additional context See https://iterm2.com/documentation-escape-codes.html

wez commented 1 year ago

FWIW, if you use shell integration with the existing semantic prompt escapes, you can use the ScrollToPrompt key assignment to get the behavior you described.

I think adding marks at arbitrary locations is reasonable, but just wanted to share that you can probably already do what you're looking for.

swsnr commented 1 year ago

Oh indeed, I had totally forgotten about this feature. I even had it in my config and didn't remember 🙈

As far as I'm concerned I'm happy; feel free to close this ticket if you like.