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

Improve session detection logic #121

Merged
merged 1 commit into from
Dec 17, 2018

Conversation

elyscape
Copy link
Contributor

Process.terminal() returns the path to the terminal attached to the process, if one exists. This will include most processes launched interactively, not just processes that represent sessions. This implements a new heuristic, in which a process is a session if it has a terminal attached and either somehow has no parent or its parent has a different terminal attached. This heuristic is probably not foolproof, but should be sufficient for the majority of cases.

Fixes #119.

Process.terminal() returns the path to the terminal attached to the
process, if one exists. This will include most processes launched
interactively, not just processes that represent sessions. This
implements a new heuristic, in which a process is a session if it has a
terminal attached and either somehow has no parent or its parent has a
different terminal attached. This heuristic is probably not foolproof,
but should be sufficient for the majority of cases.
@elyscape elyscape force-pushed the fix-session-detection branch 3 times, most recently from 66ee20e to cd7288a Compare December 13, 2018 22:09
@sean797
Copy link
Collaborator

sean797 commented Dec 17, 2018

Thanks, @elyscape. Agreed - this is a lot better than the current method!

ACK 👍

@sean797 sean797 merged commit 398ab15 into FrostyX:master Dec 17, 2018
@elyscape elyscape deleted the fix-session-detection branch December 17, 2018 13:44
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.

2 participants