wez / wezterm

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

Auto-completion for text values appearing in the buffer #1929

Open pcgeek86 opened 2 years ago

pcgeek86 commented 2 years ago

Is your feature request related to a problem? Please describe.

When I am typing a command, sometimes I usetext values that come from previous commands I've executed.

Describe the solution you'd like

When I am typing a command at the shell prompt (PowerShell), I'd like to use a keyboard shortcut to auto-complete text that appears in the buffer. iTerm2 on MacOS already does this really well, but I'm using Wezterm on Windows 11, installed using the Scoop package manager.

For example, I'd like to auto-complete the Kubernetes "context" names from this screenshot:

image

wez commented 2 years ago

Take a look at Quick Select Mode; press CTRL-SHIFT-SPACE to activate it to highlight text from the terminal buffer. You can configure the patterns used by the default quick select, or set up key assignments to trigger specific matches using QuickSelectArgs

pcgeek86 commented 2 years ago

Looks potentially useful. I'll have to figure out how to have it detect words and other elements. The default behavior is pretty cool though.

yar999 commented 2 years ago

Try clink's AutoSuggest function, which works just as well as ZSH's autoSuggest @pcgeek86

wez commented 2 years ago

I'll have to figure out how to have it detect words and other elements.

This will add a regex that matches word characters and - that seems like it would match the output in your screenshot:

return {
  quick_select_patterns = {
    "[\\w-]+"
  }
}
XobSod commented 1 year ago

That is great idea I would also like to see in WezTerm ;) I found something like this for tmux here https://tmux.reconquest.io/ but it would be nice to have it natively in the terminal itself <3

DoKoB0512 commented 3 months ago

image

Something like Warp terminal which gives a menu for reverse search with regex and case-insensitivity would be awesome to have in WezTerm

wez commented 3 months ago

@DoKoB0512 how about search mode?

image

You can use CTRL-SHIFT-F to activate it in the default key assignments, or use the Command Palette (pictured above) with CTRL-SHIFT-P and type in "search".

https://wezfurlong.org/wezterm/scrollback.html#searching-the-scrollback

DoKoB0512 commented 3 months ago

@DoKoB0512 how about search mode?

image

You can use CTRL-SHIFT-F to activate it in the default key assignments, or use the Command Palette (pictured above) with CTRL-SHIFT-P and type in "search".

https://wezfurlong.org/wezterm/scrollback.html#searching-the-scrollback

This is great. But warp's Ctrl+R also reverse-search the commands like cd and ssh that we've ran previously. I want to know if something like that is possible with the Command Palette or something else.

aoyama-val commented 3 weeks ago

+1 for the iTerm style completion. It is similar to our familiar tab completion and easier than to recognize prefix.