Comments (1)
The problem is that currently ptop takes some time to load contents to GUI.
So the problem is that is no process is selected to kill.
Hence just provide an exception handler in kill_process function.
def _kill_process(self,*args,**kwargs):
# Get the PID of the selected process
try:
pid_to_kill = self._get_selected_process_pid()
self._logger.info("Terminating process with pid {0}".format(pid_to_kill))
target = psutil.Process(int(pid_to_kill))
try:
target.terminate()
self._logger.info("Terminated process with pid {0}".format(pid_to_kill))
except:
self._logger.info("Not able to terminate process with pid: {0}".format(pid_to_kill),
exc_info=True)
except:
self._logger.info("No process selected")
from ptop.
Related Issues (20)
- Kill ptop properly HOT 4
- Killing chrome making ptop hung up
- The memory chart and process chart should be according to 100% in height HOT 1
- Feature Storming HOT 3
- New GUI can be drawn in terminal in case of terminal resizing HOT 2
- Optimize the sorting behavior
- Separate the keyboard shortcuts in some config file
- Killing a process making ptop exit abruptly HOT 3
- Python 3 compatability issue HOT 1
- Restart process option not available as mentioned in #29.
- After killing terminal misbehaviour HOT 4
- Always an Update HOT 13
- Flickering, especially in byobu. HOT 1
- The Encoding Problem HOT 1
- Can't install ptop on CentOS 7 HOT 5
- Updater doesn't consistently work HOT 1
- ptop is the name of another program so won['t launch HOT 1
- No module named '_curses' HOT 2
- Proposing a PR to fix a few small typos
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ptop.