Skip to content

remove pipe from URL handler#184

Open
john-peterson wants to merge 1 commit into
jarun:mainfrom
john-peterson:pipe
Open

remove pipe from URL handler#184
john-peterson wants to merge 1 commit into
jarun:mainfrom
john-peterson:pipe

Conversation

@john-peterson

@john-peterson john-peterson commented May 18, 2026

Copy link
Copy Markdown
Contributor

if URL handler use vim and input is piped many strange effects can result

vim tries to run commands

it prints various OS commands return value to terminal output for example 10 and 11 that return terminal colours

this will only quit it's not a full simulation

echo|vim
Vim: Warning: Input is not from a terminal
Vim: Error reading input, exiting...
Vim: Finished.

this will cause more mayhem printing random text including OSC 10 and 11 inside vim and if you try to select it vim close or crash

or another time print it to terminal instead and close immediately

python -c "from subprocess import Popen, PIPE; Popen(['vim'], stdin=PIPE)"
2RR84;0;0c10;rgb:ffff/ffff/ffff11;rgb:0000/0000/0000Vim: Finished.

but you have to connect to the pipe to get full effect and even break the terminal

python -c $'from subprocess import Popen, PIPE\nwith Popen(["vim"], stdin=PIPE) as pipe:\n pipe.communicate()'

input is still a terminal

test -t 0; echo $?
0

but it no longer repeat input so you type in blind

this will restore the terminal

stty sane

it doesn't work with vim

~~~
echo|vim
test -t 0; echo $?
stty sane
~~~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant