Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Feb 2, 2026

Activation commands (source /path/to/activate) were being saved to bash history on each terminal open, bloating history and making reverse-i-search unusable.

Changes

  • Added shellsWithLeadingSpaceHistorySupport - Shells supporting HISTCONTROL=ignorespace (bash) or setopt HIST_IGNORE_SPACE (zsh): bash, zsh, gitbash
  • Modified getShellCommandAsString - Prepends space for supported shells
// Before: "source /path/to/venv/bin/activate"
// After:  " source /path/to/venv/bin/activate"

Shell investigation

Shell Leading space support
bash, zsh, gitbash ✅ Implemented
pwsh Requires custom AddToHistoryHandler - not default
fish, sh, ksh, csh, nu Not supported
Original prompt

This section details on the original issue you should resolve

<issue_title>Bash activation command without proceeding space bloating bash-history</issue_title>
<issue_description>The activation of the venv is performed by command source $venv_path without space at the start. This result in this command stored multiple time in bash-history, bloating and overwriting it. This quickly makes reverse-i-search unusable.

Please use source $venv_path instead.</issue_description>

<agent_instructions>Investigate if we can do the same for other shells as well. Shell specific </agent_instructions>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Fix bash activation command to prevent history bloating Add leading space to shell activation commands to prevent history bloating Feb 2, 2026
Copilot AI requested a review from anthonykim1 February 2, 2026 16:13
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.

Bash activation command without proceeding space bloating bash-history

2 participants