kutsan / zsh-system-clipboard

System clipboard key bindings for Zsh Line Editor with vi mode. It is similar to what `set clipboard=unnamed` does for vim.
GNU General Public License v3.0
140 stars 16 forks source link

[Feature request] Support Linux TTY (Virtual Console) with TMUX #42

Closed davidsierradz closed 2 years ago

davidsierradz commented 2 years ago

Hi! When loading the plugin inside a TTY, this appears:

ERROR  zsh-system-clipboard: Could not find any available clipboard manager. Make sure you have wl-clipboard, xclip, or xsel installed.

ERROR  zsh-system-clipboard: Note that if wl-clipboard is installed and $DISPLAY is set, it won't be used. To override this behavior, set in your environment ZSH_SYSTEM_CLIPBOARD_USE_WL_CLIPBOARD

This is a server without xclip or xsel installed.

Could we allow using the plugin inside a TTY with TMUX and ZSH_SYSTEM_CLIPBOARD_TMUX_SUPPORT=true?

There is another bug, worth mentioning: If you use any binding like bindkey -M vicmd Y zsh-system-clipboard-vicmd-vi-yank-eol inside a TTY from a Linux system with xclip installed, this error appears:

_zsh_highlight_call_widget:2: zsh-system-clipboard-vicmd-vi-yank-eol: function definition file not found

Should we check in https://github.com/kutsan/zsh-system-clipboard/blob/master/zsh-system-clipboard.zsh#L63 that not only xclip is installed but also that we are in a GUI session ($DISPLAY)? Thanks!

doronbehar commented 2 years ago

Could we allow using the plugin inside a TTY with TMUX and ZSH_SYSTEM_CLIPBOARD_TMUX_SUPPORT=true?

Of course! This was the intended behavior, but it got slipped away during testing of this feature.

In general, I think we need to rewrite most of that logic, it's a mess. I'm working on that now @kutsan.

_zsh_highlight_call_widget:2: zsh-system-clipboard-vicmd-vi-yank-eol: function definition file not

I really don't know what this error means. Perhaps after a rewrite it'll be fixed..

doronbehar commented 2 years ago

Closing, feel free to reopen if anything doesn't work.