mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-04 08:24:40 +01:00
set process title
This commit is contained in:
parent
60c2b783fe
commit
77109e6dd7
3 changed files with 10 additions and 0 deletions
|
@ -11,6 +11,8 @@ Current Developments
|
|||
and a subprocess command exits with a non-zero return code, a
|
||||
CalledProcessError will be raised. This is useful in scripts that should
|
||||
fail at the first error.
|
||||
* If the ``setproctitle`` package is installed, the process title will be
|
||||
set to ``'xonsh'`` rather than the path to the Python interpreter.
|
||||
|
||||
**Changed:** None
|
||||
|
||||
|
|
|
@ -232,6 +232,7 @@ Xonsh currently has the following external dependencies,
|
|||
#. PLY
|
||||
#. prompt-toolkit (optional)
|
||||
#. Jupyter (optional)
|
||||
#. setproctitle (optional)
|
||||
|
||||
*Documentation:*
|
||||
|
||||
|
|
|
@ -6,6 +6,11 @@ import builtins
|
|||
from argparse import ArgumentParser, ArgumentTypeError
|
||||
from contextlib import contextmanager
|
||||
|
||||
try:
|
||||
from setproctitle import setproctitle
|
||||
except ImportError:
|
||||
setproctitle = None
|
||||
|
||||
from xonsh import __version__
|
||||
from xonsh.shell import Shell
|
||||
from xonsh.pretty import pprint
|
||||
|
@ -124,6 +129,8 @@ def _pprint_displayhook(value):
|
|||
|
||||
def premain(argv=None):
|
||||
"""Setup for main xonsh entry point, returns parsed arguments."""
|
||||
if setproctitle is not None:
|
||||
setproctitle('xonsh')
|
||||
args, other = parser.parse_known_args(argv)
|
||||
if args.file is not None:
|
||||
real_argv = (argv or sys.argv)
|
||||
|
|
Loading…
Add table
Reference in a new issue