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

Wrong application type - tracer says that nano and vim needs session restart #119

Closed
FrostyX opened this issue Dec 5, 2018 · 2 comments
Closed

Comments

@FrostyX
Copy link
Owner

FrostyX commented Dec 5, 2018

Tracer for some reason suggests that I should restart the session to deal with updated nano.

* nano
    Package:     nano
    Description: A small text editor
    Type:        Session
    State:       nano has been started by jkadlcik 33 seconds ago. PID - 5301

    Affected by: 
        nano
            /usr/bin/nano

    How to restart:
        You will have to log out & log in again
@FrostyX
Copy link
Owner Author

FrostyX commented Dec 5, 2018

Seems to be caused by 7ea0157

@elyscape
Copy link
Contributor

It looks like this is caused by the way tracer is detecting sessions. To decide if a process is a session, tracer checks to see if Process.terminal() returns a value. Unfortunately, that's not what Process.terminal() does; if the process is attached to a terminal, it returns the path to the terminal. As a result, anything attached to a terminal will be interpreted as being a session. One potential solution to this would be to do something like this:

@property
def is_session(self):
    terminal = self.terminal()
    if terminal is None:
        return None
    parent = self.parent()
    if parent is None or terminal != parent.terminal():
        return True

With this change, a process is a session if it has a terminal attached and either has no parent or its parent has a different terminal attached. This isn't foolproof logic, but seems better than what is currently implemented.

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

No branches or pull requests

2 participants