Tab key triggers twice in shell #10582

Closed
opened 2026-01-31 02:25:05 +00:00 by claunia · 8 comments
Owner

Originally created by @dgliwka on GitHub (Sep 10, 2020).

Environment

Windows build number: Microsoft Windows [Version 10.0.19041.508]

Windows Terminal version (if applicable): 1.3.2382.0

Steps to reproduce

  1. Start either cmd, PowerShell or wsl (Ubuntu 20.04) profile (with default settings.json).
  2. Hit Tab ↹ button.
  3. Tab ↹ action is executed by shell twice,

Expected behavior

Shell receives Tab key once, and therefore executes it's action once.

Actual behavior

Shell (bash on wsl, PowerShell or cmd) executes Tab key twice, resulting with two \t characters in vim, or advancing shell's directory autocompletion by two directories.

Notes:

  1. After mapping another key to Tab input code with:
    { "command": { "action": "sendInput", "input": "\u0009" }, "keys": "f2" }
    F2 key sends Tab's input code only once.
  2. It is not a problem with keyboard, as the problem appears only in Windows Terminal.
Originally created by @dgliwka on GitHub (Sep 10, 2020). # Environment ``` Windows build number: Microsoft Windows [Version 10.0.19041.508] Windows Terminal version (if applicable): 1.3.2382.0 ``` # Steps to reproduce 1. Start either cmd, PowerShell or wsl (Ubuntu 20.04) profile (with default settings.json). 2. Hit `Tab ↹` button. 3. `Tab ↹` action is executed by shell twice, # Expected behavior Shell receives Tab key once, and therefore executes it's action once. # Actual behavior Shell (bash on wsl, PowerShell or cmd) executes Tab key twice, resulting with two \t characters in vim, or advancing shell's directory autocompletion by two directories. # Notes: 1. After mapping another key to `Tab` input code with: `{ "command": { "action": "sendInput", "input": "\u0009" }, "keys": "f2" }` F2 key sends `Tab`'s input code only once. 2. It is not a problem with keyboard, as the problem appears only in Windows Terminal.
Author
Owner

@DHowett commented on GitHub (Sep 10, 2020):

Interesting. Are you using a physical or virtual keyboard? What layout is it?

@DHowett commented on GitHub (Sep 10, 2020): Interesting. Are you using a physical or virtual keyboard? What layout is it?
Author
Owner

@DHowett commented on GitHub (Sep 10, 2020):

(I ask because this doesn't seem to reproduce with US (QWERTY) hardware keyboards for anyone on the team.)

@DHowett commented on GitHub (Sep 10, 2020): (I ask because this doesn't seem to reproduce with US (QWERTY) hardware keyboards for anyone on the team.)
Author
Owner

@dgliwka commented on GitHub (Sep 10, 2020):

It's physical keyboard.
I am using Polish layout, but the problem appears also with English US and UK layout.
Also tried to change system language to English UK, but it did not help.

@dgliwka commented on GitHub (Sep 10, 2020): It's physical keyboard. I am using Polish layout, but the problem appears also with English US and UK layout. Also tried to change system language to English UK, but it did not help.
Author
Owner

@zadjii-msft commented on GitHub (Sep 11, 2020):

By any chance, did you try the workaround earlier in #4448, with setting InputServiceEnabled: 1?

@zadjii-msft commented on GitHub (Sep 11, 2020): By any chance, did you try the workaround earlier in #4448, with setting `InputServiceEnabled: 1`?
Author
Owner

@dgliwka commented on GitHub (Sep 11, 2020):

InputServiceEnabled: 1 does not help. Actually after setting this, keyboard stops working at all for Microsoft Terminal, but not for other programs.

@dgliwka commented on GitHub (Sep 11, 2020): `InputServiceEnabled: 1` does not help. Actually after setting this, keyboard stops working at all for Microsoft Terminal, but not for other programs.
Author
Owner

@DHowett commented on GitHub (Sep 14, 2020):

Sorry, I do not understand.

InputServiceEnabled: 1 is the default, but you need to enable the "Touch Keyboard and Handwriting Panel Service" service. When you have InputServiceEnabled: 1 and service started, does the keyboard continue working for Terminal?

If so, does the Tab bug still happen?

@DHowett commented on GitHub (Sep 14, 2020): Sorry, I do not understand. `InputServiceEnabled: 1` is the default, but you need to enable the "Touch Keyboard and Handwriting Panel Service" service. When you have `InputServiceEnabled: 1` and service started, does the keyboard continue working for Terminal? If so, does the Tab bug still happen?
Author
Owner

@dgliwka commented on GitHub (Sep 15, 2020):

Thank you for clarification. It solved the issue.

So for anyone in the future setting

HKLM\SOFTWARE\Microsoft\Input:
  InputServiceEnabled: 1
  InputServiceEnabledForCCI: 1

and setting service Touch Keyboard and Handwriting Panel to manual solves the problem.

@dgliwka commented on GitHub (Sep 15, 2020): Thank you for clarification. It solved the issue. So for anyone in the future setting ``` HKLM\SOFTWARE\Microsoft\Input: InputServiceEnabled: 1 InputServiceEnabledForCCI: 1 ``` and setting service `Touch Keyboard and Handwriting Panel` to `manual` solves the problem.
Author
Owner

@DHowett commented on GitHub (Sep 15, 2020):

Thanks.

I will add this to the list of issues caused by disabling random windows services!

@DHowett commented on GitHub (Sep 15, 2020): Thanks. I will add this to the list of issues caused by disabling random windows services!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#10582