Closed UtkarshVerma closed 5 months ago
Interestingly this was caused by the + 1
that I left off in my initial fix.
The reason I left it off was that when testing the default "open urls in dmenu" external pipe command the last character of the line would be cut off, e.g.
$ echo "https://fubar.com"
https://fubar.com
would show https://fubar.com
from the first echo line and https://fubar.co
from the second line.
Curiously I can't reproduce that issue anymore. I added that + 1
back in and the copyout script looks to work fine now. Maybe just keep it in mind if you notice other quirks with the externalpipe patch.
I tried the new changes and they are no longer ignoring the output after newlines. However, the "\n" in the commands are still being expanded.
Take these pictures for example: Commands that I typed.
Output sent by externalpipe. "\n" is being expanded.
I have opened too many issues recently. Please do not get overwhelmed and take your time. I just wanted to initiate a discussion before blindly attempting to solve it.
I can't seem to replicate. How are you printing / reading that file?
Ah, it was echo "$contents"
which was expanding the \n
s. Everything's fine on st's end. Thanks!
Right so this probably comes down to bash echo vs other shell echo?
In bash it defaults to not interpret backslash escapes and it has to be explicitly enabled using the -e
flag. In dash for example it interprets backslash escapes by default.
Yeah, so I ended up using printf.
I noticed that my externalpipe scripts stopped working when I turned on the reflow patch. Now, if any command has consecutive empty lines, the terminal output after that newline is not sent to the script.
This is not the case when the reflow patch is turned off.
Steps to reproduce
st-copyurl
to PATH.~/st
and notice that terminal content are included only till theprintf
command (because of the successive newlines). Additionally, the\n
inprintf
command is also unnecessarily expanded.Here's a video of the following:
https://github.com/bakkeby/st-flexipatch/assets/31820255/3a08a459-5f2b-4ff8-94dc-2702ef7e0b1f