X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=bin%2FPS;h=67574b554436acdc20ac245993d489be5183fd0c;hb=82270ed46376d16a9537a62edcb2d0906c0b2286;hp=db86d2b1b6a1e0e5ea672089284de01d770a423a;hpb=f46bd4d41cc7f243bc8a321effee5200aa69e709;p=dotfiles.git 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))