From 3c9df4ef895e5ba275001fad037e8aeeabf1680a Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 6 Apr 2014 05:47:57 +0200 Subject: remove path from process title MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/__main__.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/__main__.py b/src/__main__.py index cf4d619..54c8e94 100755 --- a/src/__main__.py +++ b/src/__main__.py @@ -54,6 +54,12 @@ def setproctitle(title): ''' import ctypes try: + # Remove path, keep only the file, + # otherwise we get really bad effects, namely + # the name title is truncates by the number + # of slashes in the title. At least that is + # the observed behaviour when using procps-ng. + title = title.split('/')[-1] # Create strng buffer with title title = title.encode(sys.getdefaultencoding(), 'replace') title = ctypes.create_string_buffer(title) -- cgit v1.2.3-70-g09d2