From b2bb82588785872e2e5e644ab42fc43b6e8bbf53 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Thu, 2 Mar 2017 00:17:34 +0300 Subject: [PATCH] bin/PS: pass option '-S' to 'less' --- bin/PS | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bin/PS b/bin/PS index db86d2b..67574b5 100755 --- a/bin/PS +++ b/bin/PS @@ -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)) -- 2.39.5