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

Make sure TERM_PROGRAM points to a valid program in run_in_new_terminal #2329

Merged
merged 1 commit into from
Jan 30, 2024

Conversation

peace-maker
Copy link
Member

Visual Studio Code sets the $TERM_PROGRAM environment variable to vscode in its terminal pane, but doesn't support opening new panes from the command line and there is no "vscode" binary.

misc.run_in_new_terminal reports pwnlib.exception.PwnlibException: Could not find terminal binary 'vscode'. Set context.terminal to your terminal.

Make sure the target binary exists before trying to launch it. This appears to be mostly set by terminals on macOS, so this should be tested in those setups if someone uses a mac ❤️

Visual Studio Code sets the $TERM_PROGRAM environment variable to `"vscode"` in its terminal pane,
but doesn't support opening new panes from the command line and there is no "vscode" binary.

Make sure the target binary exists before trying to launch it.
@teddav
Copy link
Contributor

teddav commented Jan 23, 2024

@peace-maker i dont think this would work as TERM_PROGRAM seems to refer to the terminal app being used, and not the shell. So which will not find it
https://apple.stackexchange.com/questions/42714/what-is-the-term-program-and-term-program-version-environment-variables-used-fo

If I try it on an M1 macbook, if I open a terminal in vscode I get TERM_PROGRAM=vscode
and if i do it locally I get TERM_PROGRAM=iTerm.app (i'm using ITerm2).

let me know if I misunderstood and you want me to test something

@Arusekk
Copy link
Member

Arusekk commented Jan 24, 2024 via email

@peace-maker
Copy link
Member Author

#967 introduced this while it was in the docstring before (#964). This appears to have been used as a variable that is set manually and from the code it has to be a valid executable in the path. So this PR shouldn't break that functionality.

@peace-maker peace-maker merged commit e466f5c into Gallopsled:dev Jan 30, 2024
9 checks passed
@peace-maker peace-maker deleted the term_program_env branch January 30, 2024 10:09
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