Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop using cmd.exe to keep current directory #2488

Merged
merged 4 commits into from
Oct 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pwnlib/util/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'])

Expand Down
Loading