wez / wezterm

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

Option to stop scroll on search #3684

Open MikePresman opened 1 year ago

MikePresman commented 1 year ago

Is your feature request related to a problem? Please describe. During a search when I find a place in my output to start reading logs/events I get thrown out of context because of incoming streams of data. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like Is it possible to have a flag that keeps the current position I am in my output during a search. I have events coming into my terminal that I can't control and don't want to SIGSTOP before each search to make sure I remain in context.

Then after I exit search wezterm sends a SIGCONT and takes me back down (it already does).

Describe alternatives you've considered Sending a SIGSTOP before I search

Additional context Discussed kinda here https://github.com/wez/wezterm/discussions/3492 but I'd rather search automatically sends a SIGSTOP for me (or even better is output keeps going but I remain in context of my scrollback position - but this seems rather intensive)

wez commented 1 year ago

In the meantime, you may want to try using Multiple to redefine your search key assignment so that it uses SendKey to trigger SIGSTOP and then opens search mode, then similarly, in the search_mode key table, redefine the keys that exit search mode as exiting and then sending SIGCONT.

Not sure about how best to integrate such a feature; the gui doesn't have any direct control over the terminal or its state; it may be running remote and not have a direct way to send a signal that is known to wezterm (that's the case for ssh sessions, for example).

Importantly, it is possible for the user to redefine via the stty utility which control sequences trigger SIGSTOP and SIGCONT, so without a way for wezterm to query that information, any choice that it hard codes will be the wrong choice for some portion of users.