Skip to content

Add terminal.integrated.suggest.insertTrailingSpace setting - #273384

Merged
Daniel Imms (Tyriar) merged 5 commits into
mainfrom
copilot/add-terminal-insert-trailing-space
Oct 27, 2025
Merged

Daniel Imms (Tyriar) merged 5 commits into
mainfrom
copilot/add-terminal-insert-trailing-space

Conversation

Copilot AI commented Oct 26, 2025 •

Copy link
Copy Markdown
Contributor

Adds user-configurable setting to automatically insert a space after accepting terminal suggestions, addressing feedback that users must manually space after completions.

Changes

  • Configuration (terminalSuggestConfiguration.ts)

    • Added terminal.integrated.suggest.insertTrailingSpace boolean setting (default: false)
    • Added to TerminalSuggestSettingId enum and ITerminalSuggestConfiguration interface
  • Implementation (terminalSuggestAddon.ts)

    • Modified acceptSelectedSuggestion to append space to resultSequence when enabled
    • Excludes Folder and SymbolicLinkFolder types to preserve seamless directory navigation

Behavior

// When enabled and accepting a command suggestion
"git sta" + Tab → "git status "  // space added

// But for folders, no space to allow continued navigation
"cd ~/Doc" + Tab → "cd ~/Documents"  // no space, can continue with /subfolder

Default remains false for backward compatibility. Aligns with issue discussion about making this a user preference rather than forced behavior.

Original prompt

This section details on the original issue you should resolve

<issue_title>Accepting a terminal command should insert it with a space at the end</issue_title>
<issue_description>Testing #241771

Currently it seems to just put it, so I have to space manually</issue_description>

<agent_instructions>Add a new setting to terminalSuggestConfiguration.ts called "terminal.integrated.suggest.insertTrialingSpace` that implements the suggestion</agent_instructions>

Comments on the Issue (you are Copilot in this section)

Daniel Imms (@Tyriar) I think these are one of those tweaks that depends on the user. We went with no space because there will not be a space when completing folders in order to enable easily navigating to sub-dirs/files and we want to be as consistent as possible with the editor which does not add a space.

Should we have a setting that adds a space to everything except directories?</comment_new>
<comment_new>Benjamin Pasero (@bpasero)
I think this becomes more interesting when you tab, get it inserted with space and then get to see suggest widget again to do the next tab.</comment_new>


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI self-assigned this Oct 26, 2025
Copilot AI changed the title [WIP] Add setting to insert trailing space for terminal commands Add terminal.integrated.suggest.insertTrailingSpace setting Oct 26, 2025
@Tyriar Daniel Imms (Tyriar) added this to the October 2025 milestone Oct 26, 2025
@Tyriar

Copy link
Copy Markdown
Contributor

Recording 2025-10-26 at 04 41 33

@Tyriar
Daniel Imms (Tyriar) marked this pull request as ready for review October 26, 2025 11:42
Copilot AI review requested due to automatic review settings October 26, 2025 11:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a user-configurable setting (terminal.integrated.suggest.insertTrailingSpace) to automatically insert a trailing space after accepting terminal suggestions, addressing user feedback about having to manually add spaces after completions.

  • Adds new configuration setting with default value of false for backward compatibility
  • Implements logic to append space when accepting non-folder suggestions
  • Triggers re-suggestion after space insertion to enable continuous tab-completion workflow

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
terminalSuggestConfiguration.ts Adds new boolean setting with enum value, interface property, and configuration schema
terminalSuggestAddon.ts Implements trailing space insertion logic with folder exclusion and re-suggestion triggering

{
let sent = false;

// If completions were requested from the addon

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is confusing as it's within the addon class.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is the addon that requested it though, open to suggestions

@Tyriar
Daniel Imms (Tyriar) merged commit d07e49d into main Oct 27, 2025
@Tyriar
Daniel Imms (Tyriar) deleted the copilot/add-terminal-insert-trailing-space branch October 27, 2025 13:34
@vs-code-engineering vs-code-engineering Bot locked and limited conversation to collaborators Dec 11, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Accepting a terminal command should insert it with a space at the end

4 participants