Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix frozen terminal caused by opener #858

Merged
merged 2 commits into from
Feb 18, 2021
Merged

Fix frozen terminal caused by opener #858

merged 2 commits into from
Feb 18, 2021

Conversation

KlzXS
Copy link
Collaborator

@KlzXS KlzXS commented Feb 16, 2021

xdg-open would launch a cli program that would contest the terminal for character input resulting in a unresponsive terminal that's hard to use. There are many references to this issue, but I'm bad at finding them.

If you send xdg-opens's std{in,out,err} to the shadow realm it seems to prevent it from launching cli programs (probably because they don't want to work without any I/O, but I guess you can may be able to find some oddballs) so it defaults to some gui program (probably firefox) and that doesn't block the terminal.

This should be tested to make sure the other openers are okay with silencing their std{in,out,err}.

xdg-open would launch a cli program that would contest the terminal for character input
@jarun
Copy link
Owner

jarun commented Feb 17, 2021

@KlzXS can you share some test cases?

@KlzXS
Copy link
Collaborator Author

KlzXS commented Feb 17, 2021

Right. I use LICENSE but any text/plain file should do. Just hover over it and press l or Enter to open it.
In my case it decides to open with vim for you it may be some other terminal editor or maybe even less depends on your configuration. Doesn't matter really, as long as it's a terminal program that accepts input from stdin the problem holds.

You won't see anything change but your keypresses will now be "ignored" at random, effectively making the terminal unusable.

@KlzXS
Copy link
Collaborator Author

KlzXS commented Feb 17, 2021

I forgot to mention. Of course if you have it setup so that text/plain files are opened in a gui editor like sublime you won't be experiencing this with text files. Right now I can't think of a non-text file that is commonly opened in terminal, but any such would also exhibit this behavior.

@jarun jarun merged commit 5c47ac6 into jarun:master Feb 18, 2021
@jarun
Copy link
Owner

jarun commented Feb 18, 2021

Thank you!

@jarun jarun mentioned this pull request Feb 18, 2021
21 tasks
@github-actions github-actions bot locked and limited conversation to collaborators Mar 21, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants