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

Fixes#45 [ Process restart function ] #48

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

shv07
Copy link

@shv07 shv07 commented Nov 12, 2018

Added Ctrl+S key function for restarting processes like web browsers, text editors,...

Added ^S for restart for processes like web browsers, text editors,....
@darxtrix
Copy link
Owner

Thanks for the contribution. Let me go through this.

@darxtrix darxtrix changed the title Issue 45 Fixes #45 [ Process restart function ] Nov 12, 2018
@darxtrix darxtrix changed the title Fixes #45 [ Process restart function ] Fixes#45 [ Process restart function ] Nov 12, 2018
@darxtrix
Copy link
Owner

Hi @iMshivji, restarting a process require multiple things, like commandline paramteres, working directory, enviroment and invoking user etc. The current implementation of restart process is not applicable to all processes. We can only add this to ptop if we have a more concrete restart function that is able to restart all the processes. You can use subProcess to set all this params before starting the process. Lets try to implement that, I will be happy to help. Adding some code for more understanding,

>>> k = psutil.Process(int(5708))
>>> k.cmdline()
['tail', '-f', '.ptop.log']
>>> k.cwd()
'/home/darxtrix'
>>> k.username()
'darxtrix'
>>> k.environ()
# My environment params

@shv07
Copy link
Author

shv07 commented Nov 14, 2018

@darxtrix , thank you for your comments. I am working on improving the restart function and would try to fix it soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants