-
Notifications
You must be signed in to change notification settings - Fork 30k
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
Do not pollute shell history with automatically executed debugger commands #88038
Comments
If you were wondering why someone might want this, I like that the history is there. All the time I go to my command line and use up arrow enter to rerun the last auto generated command. I've also gone through the history a bunch to rerun previous auto generated commands too. |
Aye, this is why I opted for simply adding a space instead of something more aggressive such as EDIT: Also, in my shell, commands which were run with a space can still be reached by pressing the up key in the active session, but I'm not sure this is the case in other shells. |
On MacOS the leading space character seems to get dropped in the Applescript that talks to the Terminal application. So the feature at hand only works for the integrated terminal for now. I've created a new feature request for the external terminal. Since @connor4312 has verified that the fix works for the integrated terminal, I'm adding the "verified" label. |
Currently, when a debugger is executed (ie by hitting F5), a terminal is opened and the debugger is executed as a command.
This command can get pretty long as it also changes to the working directory and sets some environment variables. Running the Python debugger in a simple project with only one file runs a command which is 243 characters long.
This, however, means that these commands which are not meant to be run by the user but are instead run automatically are still included in the user's shell history file by default.
I propose changing the command generation function
prepareCommand()
to include a space at the very beginning - on many shells across various distros,$HISTCONTROL
is set to not add commands to history if they start with a space character. This also gives some control to the user whether they'd like for the debugger commands to be stored in history or not.The text was updated successfully, but these errors were encountered: