wezterm icon indicating copy to clipboard operation
wezterm copied to clipboard

Auto-completion for text values appearing in the buffer

Open pcgeek86 opened this issue 2 years ago • 4 comments

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

pcgeek86 avatar Apr 28 '22 13:04 pcgeek86

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

wez avatar Apr 28 '22 14:04 wez

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.

pcgeek86 avatar Apr 28 '22 14:04 pcgeek86

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

yar999 avatar Apr 29 '22 12:04 yar999

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-]+"
  }
}

wez avatar Apr 29 '22 13:04 wez

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

XobSod avatar Mar 15 '23 12:03 XobSod