Skip to content

[Feature Request] Improve Default Compatibility for TUI Applications by Re-evaluating the DefaultShift+TabKeybinding #4818

@Kirchlive

Description

@Kirchlive

Prerequisites

  • Write a descriptive title.

Description of the new feature/enhancement

Hello PSReadLine Team,

First, thank you for your incredible work on PSReadLine—it makes PowerShell a world-class interactive shell.

I'm opening this discussion to highlight a recurring compatibility issue between PSReadLine's default keybindings and the growing ecosystem of modern, cross-platform TUI (Text-based User Interface) applications, especially those built with Node.js.

The Core Problem:
By default, PSReadLine binds Shift+Tab to the PreviousMenuComplete function. While useful for PowerShell's own completion menus, this binding effectively "swallows" the keypress. This prevents the key combination from reaching any underlying TUI application that relies on Shift+Tab for its own core functionality, such as reverse tabbing or mode switching.

A Concrete Example: Google's Gemini CLI
A prime example is the new Gemini CLI. Its interactive mode uses Shift+Tab to toggle between single-line and multi-line input. On Windows with PowerShell, this feature is completely broken out-of-the-box because PSReadLine intercepts the key. The user experience is that the key simply "does nothing." Google Issue Tracker: https://issuetracker.google.com/issues/428230522.

The Workaround:
The current solution requires users to be PowerShell experts. They must discover this conflict and manually add the following to their $profile:
Set-PSReadLineKeyHandler -Key Shift+Tab -Function PassThrough
or
Remove-PSReadLineKeyHandler -Key Shift+Tab

While this works, it presents a significant hurdle for users who expect modern tools to work without deep shell configuration.

Proposal for Discussion:
Would the team be open to discussing a change to the default behavior to improve out-of-the-box compatibility for TUIs? Possible avenues could be:

  1. Unbind Shift+Tab by Default: Is the PreviousMenuComplete function essential enough to justify breaking a de-facto standard keybinding for reverse navigation in TUIs? Perhaps it could be left unbound by default.
  2. Introduce a "TUI-Friendly Mode": A mode that could be toggled, which automatically sets PassThrough for common TUI navigation keys.
  3. Smarter PassThrough: Could PSReadLine be smart enough to automatically pass through Shift+Tab if no completion menu is currently active?

This change would greatly improve the user experience for a growing class of important developer tools on Windows, making PowerShell an even more welcoming environment for them.

Thank you for your consideration.

Proposed technical implementation details (optional)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions