Make getting cmdline of a PID a bit more convenient

This commit is contained in:
Kovid Goyal
2022-06-04 15:07:08 +05:30
parent b3578a4fa5
commit 5a0a980648
3 changed files with 18 additions and 9 deletions

View File

@@ -747,7 +747,6 @@ def remote_edit(msg: str, window: Window) -> None:
def clone_and_launch(msg: str, window: Window) -> None:
from .child import cmdline_of_process
from .shell_integration import serialize_env
c = CloneCmd(msg)
if c.cwd and not c.opts.cwd:
@@ -782,8 +781,9 @@ def clone_and_launch(msg: str, window: Window) -> None:
patch_cmdline('env', entry, cmdline)
c.opts.env = []
else:
try:
cmdline = cmdline_of_process(c.pid)
cmdline = window.child.cmdline_of_pid(c.pid)
except Exception:
cmdline = []
if not cmdline: