Skip to content

fix(input): Tab accepts inline autosuggestion directly instead of opening popup#10239

Open
hayekw wants to merge 3 commits intowarpdotdev:masterfrom
hayekw:fix/tab-accepts-inline-autosuggestion
Open

fix(input): Tab accepts inline autosuggestion directly instead of opening popup#10239
hayekw wants to merge 3 commits intowarpdotdev:masterfrom
hayekw:fix/tab-accepts-inline-autosuggestion

Conversation

@hayekw
Copy link
Copy Markdown

@hayekw hayekw commented May 6, 2026

Summary

  • When an inline autosuggestion (gray hint) is visible, pressing Tab now accepts it directly instead of opening the completion popup
  • Added pub(crate) to insert_full_autosuggestion so input.rs can call it
  • Added integration test test_tab_accepts_autosuggestion_directly

Motivation

Typing cd shows a gray hint (e.g. hfi.network/), but Tab was ignoring it and opening the popup menu instead — requiring an extra keypress. This PR makes Tab accept the hint directly, matching Fish shell / VS Code behavior.

Test plan

  • Gray hint visible → Tab accepts it directly, no popup opens
  • No gray hint → Tab still opens completion menu as before
  • New integration test: test_tab_accepts_autosuggestion_directly

@cla-bot
Copy link
Copy Markdown

cla-bot Bot commented May 6, 2026

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Jason Wang.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email [email protected]
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented May 6, 2026

@hayekw

I'm starting a first review of this pull request.

You can view the conversation on Warp.

I completed the review and no human review was requested for this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@github-actions github-actions Bot added the external-contributor Indicates that a PR has been opened by someone outside the Warp team. label May 6, 2026
@cla-bot
Copy link
Copy Markdown

cla-bot Bot commented May 6, 2026

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Jason Wang.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email [email protected]
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

@cla-bot
Copy link
Copy Markdown

cla-bot Bot commented May 6, 2026

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Jason Wang.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email [email protected]
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

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

Overview

This PR changes Tab handling so an active inline autosuggestion is accepted before opening shell completions, and adds an integration test for that behavior.

Concerns

  • The new Tab branch conflicts with the existing autosuggestion/completion flow that expects Tab to open completions and clear autosuggestions when that feature flag is enabled.
  • The added integration test seeds history with cd . but expects an autosuggestion for hfi.network, so it is likely asserting a tab-completion candidate rather than the autosuggestion source it needs.

Verdict

Found: 0 critical, 2 important, 0 suggestions

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Comment thread app/src/terminal/input.rs
.editor
.read(ctx, |editor, _| editor.active_autosuggestion());

if has_autosuggestion {
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.

⚠️ [IMPORTANT] This branch prevents the existing RemoveAutosuggestionDuringTabCompletions path from opening completions when an autosuggestion is active; the existing integration test that enables that flag and expects Tab to open the menu will now fail or needs to be updated with the intended behavior.

// Execute a command so that we can generate autosuggestions.
.with_step(execute_command_for_single_terminal_in_tab(
0,
"cd .".into(),
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.

⚠️ [IMPORTANT] This seeds autosuggestions with cd ., but the assertion below expects hfi.network; creating that directory only makes it a tab-completion candidate, so seed history with the expected command or assert the . autosuggestion instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external-contributor Indicates that a PR has been opened by someone outside the Warp team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant