diff --git a/news/is_3661.rst b/news/is_3661.rst index c0d7041aa..8f860bcb8 100644 --- a/news/is_3661.rst +++ b/news/is_3661.rst @@ -21,6 +21,8 @@ When multiple interpreters are in PATH, 'py' will choose the first one (usually in the virtual environment), but 'py -3' finds the system-wide one, apparently by design. +* For xonsh-cat, avoid parsing and processing first (0'th) argument when invoked directly from OS shell. + **Security:** diff --git a/setup.py b/setup.py index 01ffdd95f..54fbb1342 100755 --- a/setup.py +++ b/setup.py @@ -379,7 +379,7 @@ def main(): "pytest11": ["xonsh = xonsh.pytest_plugin"], "console_scripts": [ "xonsh = xonsh.main:main", - "xonsh-cat = xonsh.xorutils.cat", + "xonsh-cat = xonsh.xoreutils.cat:cat_main", ], } skw["cmdclass"]["develop"] = xdevelop diff --git a/xonsh/xoreutils/cat.py b/xonsh/xoreutils/cat.py index af45554a8..ebff16bfa 100644 --- a/xonsh/xoreutils/cat.py +++ b/xonsh/xoreutils/cat.py @@ -161,7 +161,7 @@ def cat_main(args=None): from xonsh.main import setup setup() - args = sys.argv if args is None else args + args = sys.argv[1:] if args is None else args cat(args, sys.stdin, sys.stdout, sys.stderr)