-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Starting fish background job in an event/variable handler borks commandline for duration of job #7842
Comments
@faho Is there anything I can do right now with fish script to remove this problem? Fish 3.3 might be a while and this is an annoying bug in my project 😄 |
As it turns out otherwise fish would hang when sddm starts it as the login shell. Belongs to #7842.
@IlanCosman I'll leave you in the capable hands of the others, I'm taking a break. |
@ridiculousfish 😅 Sorry to bother, but would you happen to know a fancy Fish trick to get around this? |
@IlanCosman on Linux you can use function on_foo --on-event foo
setsid fish --command "sleep 3" &
end I'm not sure about which portable solution is best. Apparently |
Huh, it seems simply setting |
@IlanCosman That is emphatically not a knob you want to touch (to be honest it should not exist to begin with, but we're working on that). Instead simply set the background process's stdin to /dev/null: fish --command "sleep 3" </dev/null & Since the issue is that fish only checks if the group controlling the stdin terminal is its group, just make it so that stdin isn't a terminal. |
Thanks a ton @faho! Yah, setting the job-control was a bit sketchy, I noticed it was setting the user's This is why you can't take a break Fabian, I need you too much ❤️😂 |
This reproduces for me in 3.2.1, so I don't think it's a regression. |
It's a regression from 3.2.0, caused by 013a563 |
OK, I'd prefer to keep the regression tag for "things that aren't in a release" as it means I can skip over them for the release notes. |
013a563 made it so we only try to adjust terminal modes if we are in the terminal pgroup, but that's not enough. Fish starts background jobs in events inside its own pgroup, so function on-foo --on-event foo fish -c 'sleep 3' & end would have the backgrounded fish try to fiddle with the terminal and succeed. Instead, only fiddle with the terminal if we're interactive (this should probably be extended to other bits, but this is the particular problematic part) Fixes #7842. (cherry picked from commit e4fd664)
fish, version 3.2.1-5-gd79f86407
Tested on MacOS and Arch
not-highlighting.mp4
Syntax highlighting will be disabled for the full duration of the background job, i.e if you replace
sleep 3
withsleep 10
it'll take 10 seconds to come back instead.This also happens with
--on-variable
, and I presume all other handlers though I haven't tested them.Interestingly this bug doesn't appear when running other commands such as
sleep
orkill
, it only seems to work withfish
.Not sure if this is a regression.
The text was updated successfully, but these errors were encountered: