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

Can't exit out of endless loop calling builtin #388

Closed
occivink opened this issue Jul 6, 2017 · 2 comments
Closed

Can't exit out of endless loop calling builtin #388

occivink opened this issue Jul 6, 2017 · 2 comments
Labels

Comments

@occivink
Copy link

occivink commented Jul 6, 2017

Hi,

If you run while $true { echo a } (or any other builtin in the loop) you'll be stuck in an endless loop.
It looks as though builtin commands can't be interrupted.

@xiaq xiaq added the bug label Jul 6, 2017
@xiaq
Copy link
Member

xiaq commented Jul 6, 2017

There is a channel that exposes interrupts, but since goroutines cannot be interrupted from outside, we need to insert selects on this channel to ensure that interrupts are respected. For instance, the esleep commands respect interrupts; you can verify this by running esleep 10 and ^C it.

Making sure that each builtin respects interrupts can be a bit tricky, but there is one low-hanging fruit: before the execution of each pipeline, check this channel and if there are interrupt signals, abort the execution.

xiaq added a commit that referenced this issue Jul 8, 2017
@xiaq
Copy link
Member

xiaq commented Oct 17, 2019

Builtin commands are now interruptible.

@xiaq xiaq closed this as completed Oct 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants