From 7dceeddca88d315a420912d06382f650e7fcae24 Mon Sep 17 00:00:00 2001 From: robbert1978 <31349426+robbert1978@users.noreply.github.com> Date: Thu, 24 Oct 2024 20:51:07 +0700 Subject: [PATCH] Stop using cmd.exe to keep current directory (#2488) * Stop using cmd.exe to keep current directory * Update misc.py * Update misc.py, deal with cmd.exe * Update misc.py --- pwnlib/util/misc.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pwnlib/util/misc.py b/pwnlib/util/misc.py index 08815531a..e55465d33 100644 --- a/pwnlib/util/misc.py +++ b/pwnlib/util/misc.py @@ -370,13 +370,13 @@ def run_in_new_terminal(command, terminal=None, args=None, kill_at_exit=True, pr terminal = 'cmd.exe' args = ['/c', 'start'] distro_name = os.getenv('WSL_DISTRO_NAME') + current_dir = os.getcwd() # Split pane in Windows Terminal if 'WT_SESSION' in os.environ and which('wt.exe'): - args.extend(['wt.exe', '-w', '0', 'split-pane', '-d', '.']) - + args.extend(['wt.exe', '-w', '0', 'split-pane']) if distro_name: - args.extend(['wsl.exe', '-d', distro_name, 'bash', '-c']) + args.extend(['wsl.exe', '-d', distro_name, '--cd', current_dir, 'bash', '-c']) else: args.extend(['bash.exe', '-c'])