laughedelic / pisces

♓️ Fish shell plugin that helps you to work with paired symbols in the command line

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Copy paste

mattddowney opened this issue · comments

Copy pasting creates undesired behavior.

Pasting the following into my terminal:
echo -e "\e[1;31mSome red message\e[0m"

Will result in:
echo -e "\e[1;31mSome red message\e[0m""]]"

At first I thought it might be my terminal, but the behavior exists whether I use terminator, xterm, or the default terminal for Xubuntu 16.04.

@mattddowney I see this problem on fish 2.3.0. Which version of fish do you use?

2.3.0.

Digging into this, it looks like what might need to happen is to compare the contents of the clipboard with the input. IE:

xsel --clipboard

Hi @mattddowney. Have you come up with any solution/workaround?

I looked into it, but wasn't able to get anything working that didn't cause more bugs

Hi @mattddowney! I think I have good news regarding this issue.

I recently updated to fish 2.6 and noticed that I can't reproduce this bug, because they implemented bracketed (a.k.a safe) paste in v2.6 🎉 From the v2.6 release notes:

Under terminals which support it, bracketed paste is enabled, escaping problematic characters for security and convience (#3871). Inside single quotes ('), single quotes and backslashes in pasted text are escaped (#967). The fish_clipboard_paste function (bound to C-v by default) is still the recommended pasting method where possible as it includes this functionality and more.

I just tested on clean environment different versions and observed that the problem persists up to fish 2.5, but disappears in 2.6. So I'm going to close it. Anyway, if you can upgrade to fish 2.6 and confirm that the issue is not relevant anymore, please write here a comment 😉

Updated to 2.6.0

Issue is gone in Terminator and XTerm, however, the issue persists in VSCode's integrated terminal (v1.14.2). Pretty sure this is something upstream though, because C-v works fine, but right click > paste does not.

But it seems to mostly work, so that's awesome. Thanks for keeping up with this!

Cool! Thanks for the info. I'm glad that it's (mostly) solved for you. Can't say anything about VSCode though, but as you say, it should be something upstream..