summaryrefslogtreecommitdiffstats
path: root/src/__main__.py
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-04-06 05:47:57 +0200
committerMattias Andrée <maandree@operamail.com>2014-04-06 05:47:57 +0200
commit3c9df4ef895e5ba275001fad037e8aeeabf1680a (patch)
tree334f59fbdd1d483e3903bc784c42b0aa6c82a8c0 /src/__main__.py
parentbump version (diff)
downloadblueshift-3c9df4ef895e5ba275001fad037e8aeeabf1680a.tar.gz
blueshift-3c9df4ef895e5ba275001fad037e8aeeabf1680a.tar.bz2
blueshift-3c9df4ef895e5ba275001fad037e8aeeabf1680a.tar.xz
remove path from process title
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src/__main__.py')
-rwxr-xr-xsrc/__main__.py6
1 files changed, 6 insertions, 0 deletions
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)