fish-shell/share
Johannes Altmanninger 4de2891507 fish_clipboard_copy: make it work inside SSH/containers via OSC 52
When running inside SSH, Control-X runs a clipboard utility on the remote
system.  For pbcopy (and probably clip.exe too) this means that we write to the
remote system's clipboard. This is usually not what the user wants (although
it is consistent with  fish_clipboard_paste).  When X11 forwarding is used,
xclip/xsel copy to the SSH client's clipboard, which is what most users want.

When we don't have X11 forwarding, we need a different solution. Fortunately,
modern terminal emulators implement the OSC 52 escape sequence for setting
the clipboard of the terminal's system. Use it in fish_clipboard_copy.

Tested in SSH and Docker containers on foot, iTerm2, kitty, tmux and xterm
(this one requires "XTerm.vt100.allowWindowOps: true").

Should also work in GNU screen and Windows Terminal. On terminals that don't
support OSC 52 (like Gnome Terminal or Konsole), it seems to do nothing.

Since there does not seem to be a way to feature-probe OSC 52, let's just
always do both (pbcopy and friends as well as OSC 52).  In future, we should
probably stop calling pbpaste and clip.exe, at least on remote systems.

I think there is also an escape sequence to request pasting the system
clipboard but that's less important and less popular, possibly due to
security concerns.
2022-10-24 22:45:45 +02:00
..
completions Add nvme completions 2022-10-22 17:16:14 +01:00
functions fish_clipboard_copy: make it work inside SSH/containers via OSC 52 2022-10-24 22:45:45 +02:00
groff workaround broken groff man page config 2016-10-19 13:43:04 -07:00
tools disco prompt: Pad hash 2022-08-27 16:38:36 +02:00
__fish_build_paths.fish.in Rename "snippets" to "conf" internally, and document them as snippets 2016-04-06 09:33:09 +08:00
config.fish Store the vendor directories in global variables 2022-10-19 20:06:35 +02:00
lynx.lss Install custom LSS script to /usr/local/share/fish on make install 2017-09-26 14:31:11 -05:00