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

Support opening of new terminal windows in WSL #1503

Merged
merged 1 commit into from
May 27, 2020

Conversation

peace-maker
Copy link
Member

Detect if pwntools is running in a Windows Subsystem for Linux "VM" and set the terminal to open a new cmd.exe window on the host.

This replaces the need to add context.terminal = ['cmd.exe', '/c', 'start', 'ubuntu', 'run'] to every script. Instead of hardcoding a distribution like ubuntu use the selected default distribution in WSL. Running wsl.exe instead of bash.exe caused the new window to close immediately, so I've settled with bash.exe. If someone has a different bash.exe in their path before the WSL binaries - well they'll need to fix their environment.

https://devblogs.microsoft.com/commandline/a-guide-to-invoking-wsl/

Debugging using gdb.attach under WSL with gdb in a new window out of the box! Since this is added as the last option in the list of possible terminals, running screen or tmux in wsl will still use those.

Detect if pwntools is running in a Windows Subsystem for Linux "VM" and set the terminal to open a new `cmd.exe` window on the host.

This replaces the need to add `context.terminal = ['cmd.exe', '/c', 'start', 'ubuntu', 'run']` to every script.

Debugging using `gdb.attach` under WSL with gdb in a new window out of the box!
@zachriggle
Copy link
Member

This is great, thanks!

@Arusekk Arusekk merged commit ef40a31 into Gallopsled:dev May 27, 2020
@peace-maker peace-maker deleted the wsl_terminal branch May 27, 2020 21:47
@152334H 152334H mentioned this pull request Nov 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants