From 45f7bbce213322b15e468cbc57fa1bedd997b5ee Mon Sep 17 00:00:00 2001 From: Elias Kahl Date: Fri, 28 Apr 2023 11:56:00 +0200 Subject: [PATCH] Fix #74 --- src/shellingham/posix/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/shellingham/posix/__init__.py b/src/shellingham/posix/__init__.py index b81bf08..3dfde8c 100644 --- a/src/shellingham/posix/__init__.py +++ b/src/shellingham/posix/__init__.py @@ -71,6 +71,11 @@ def _get_shell(cmd, *args): if cmd.startswith("-"): # Login shell! Let's use this. return _get_login_shell(cmd) name = os.path.basename(cmd).lower() + if name == "rosetta" or name.contains("qemu-"): + # Running (probably in docker) with rosetta or qemu, first arg is real command + cmd = args[0] + args = args[1:] + name = os.path.basename(cmd).lower() if name in SHELL_NAMES: # Command looks like a shell. return (name, cmd) shell = _get_interpreter_shell(name, args)