#10941 closed bug (fixed)
[Terminal] closes when clicking hyperlink
Reported by: | diver | Owned by: | bonefish |
---|---|---|---|
Priority: | normal | Milestone: | R1 |
Component: | Applications/Terminal | Version: | R1/Development |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Platform: | All |
Description
Terminal tab/window closes when clicking hyperlink. To repro:
- Execute
pwd
- Hold command key and start clicking
/boot/home
hyperlink
Usually 5-10 times is enough to close current tab, though sometimes clicking it once is enough too.
Change History (5)
follow-up: 5 comment:1 by , 10 years ago
follow-up: 4 comment:2 by , 10 years ago
I should note that sometimes clicking a hyperlink also closes other Terminal tabs/windows.
comment:3 by , 10 years ago
Status: | new → in-progress |
---|
comment:4 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | in-progress → closed |
Replying to diver:
I should note that sometimes clicking a hyperlink also closes other Terminal tabs/windows.
That other windows are closed sounds somewhat dubious, since those belong to different processes and shouldn't get any signals related to the current one.
comment:5 by , 10 years ago
Replying to bonefish:
In theory the same can happen when a shell is terminated with
exit
-- i.e. the PTY reader from a different tab may handle the SIGCHLD and thus the wrong tab (in addition to the right one) may be closed. I don't think I have ever observed this; it may be unlikely due to how the timings of the different threads work out in this situation.
I see that quite a bit, maybe once a day at least, when doing Alt-T/Alt-W in terminal even (and also with exit indeed), it sometimes closes the whole terminal. Doing my daily "pkgman update" right now to get the latest and greatest.. And thought I would mention to you the benefits these tickets fixes have on this guy here, among many others :-) Kudos.
I've tracked the issue down to `TermParse::PtyReader()` where a
TermBuffer::NotifyQuit()
is invoked when reading from the TTY failed. In this case it fails withB_INTERRUPTED
due to a SIGCHLD being handled. The hyperlink is opened viasystem("/bin/open ...")
and after having launched/notified whatever program is responsible for the link "open" quits and Terminal receives a SIGCHLD. If the signal is handled in the PTY reader thread while it is in the aforementionedread()
inTermParse::PtyReader()
the error occurs.In theory the same can happen when a shell is terminated with
exit
-- i.e. the PTY reader from a different tab may handle the SIGCHLD and thus the wrong tab (in addition to the right one) may be closed. I don't think I have ever observed this; it may be unlikely due to how the timings of the different threads work out in this situation.Possible solutions:
TermParse::PtyReader()
explicitly.Since the same or similar problems may occur in other parts of the code, 1. may fix only one of the symptoms. 2. Requires a new thread, but would solve all similar issues for good. Using
sigwaitinfo()
it would be fairly simple to implement and we could even get rid of the signal handler and the extra thread that is spawned when the signal arrives.