austinjones / tab-rs

The intuitive, config-driven terminal multiplexer designed for software & systems engineers
MIT License
660 stars 29 forks source link

History search #256

Open austinjones opened 3 years ago

austinjones commented 3 years ago

Add a new fuzzy finder mode that searches command history.

Tab would need to build an index of command history.

nebbishhacker commented 3 years ago

Would this search the history of all tabs? Normally I just use the reverse-i-search, but it doesn't really help when I can't remember what tab I was last doing something in.

austinjones commented 3 years ago

Yeah - that's what I was thinking. If I know I typed 'npm run serve' or 'vi README.md' somewhere, help me find that tab.

The challenge is collecting the command history. It probably needs to be parsed from stdin. I also thought about using history files, but it would be nice to not rely on shell-specific behavior.

pzmarzly commented 1 year ago

You can configure most shells (zsh, bash, ...) to surround user input with OSC 133 ; A and OSC 133 ; B, and then in tab-rs look for these characters coming up on pty.