]> git.phdru.name Git - dotfiles.git/blobdiff - bin/PS
Fix(bin/cp_recode_fname): Fix misspelled message
[dotfiles.git] / bin / PS
diff --git a/bin/PS b/bin/PS
index db86d2b1b6a1e0e5ea672089284de01d770a423a..7fbd8b1cfb3b2b75c1303a2ad543af0f66f56f66 100755 (executable)
--- a/bin/PS
+++ b/bin/PS
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
 
 import sys, os
 
@@ -7,4 +7,11 @@ if "--sort=" not in args:
    args += " --sort=user"
 
 pager = os.environ.get("PAGER", "more")
+# if pager is 'less', option '-S' must be passed to it
+if pager == 'less':
+    less = os.environ.get("LESS") or ''
+    opt = 'S'
+    if opt not in less:
+        less = opt + less
+        os.environ["LESS"] = less
 os.system("ps %s | %s" % (args, pager))