Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alt arrow keys do nothing; key unbinding broken? #3729

Closed
paulwhiting opened this issue Nov 27, 2019 · 16 comments · Fixed by #4988
Closed

Alt arrow keys do nothing; key unbinding broken? #3729

paulwhiting opened this issue Nov 27, 2019 · 16 comments · Fixed by #4988
Assignees
Labels
Area-Input Related to input processing (key presses, mouse, etc.) Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-1 A description (P1) Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.
Milestone

Comments

@paulwhiting
Copy link

Environment

Windows build number: 10.0.18362.0
Windows Terminal version:  0.7.3291.0

Any other software?
- Ubuntu 16.04.3 LTS
- byobu version 5.106
- tmux 2.1

Note

This issue is a follow-on to #3101. In that issue superfluous keys were being generated. Now it appears no keys are being generated. Alt arrows are dead to me.

Steps to reproduce

  • Start Byobu: byobu
  • Create a new Byobu tab: F2
  • Press alt left or alt right to switch between the tabs

Expected behavior

Byobu switches between the two tabs.

Actual behavior

Nothing happens.

@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Nov 27, 2019
@paulwhiting
Copy link
Author

paulwhiting commented Nov 27, 2019

This behavior is due to #3585. Proper expected behavior is restored with the following:

    "keybindings": [
	{ "command": "unbound", "keys": [ "alt+shift+-" ] },
        { "command": "unbound", "keys": [ "alt+shift+plus" ] },
        { "command": "unbound", "keys": [ "alt+down" ] },
        { "command": "unbound", "keys": [ "alt+left" ] },
        { "command": "unbound", "keys": [ "alt+right" ] },
        { "command": "unbound", "keys": [ "alt+up" ] },
        { "command": "unbound", "keys": [ "alt+shift+down" ] },
        { "command": "unbound", "keys": [ "alt+shift+left" ] },
        { "command": "unbound", "keys": [ "alt+shift+right" ] },
        { "command": "unbound", "keys": [ "alt+shift+up" ] }
    ]

@paulwhiting paulwhiting changed the title Alt arrow keys do nothing. Alt arrow keys do nothing Nov 27, 2019
@sivaramn
Copy link

This behavior is due to #3585. Proper expected behavior is restored with the following:

    "keybindings": [
	{ "command": "unbound", "keys": [ "alt+shift+-" ] },
        { "command": "unbound", "keys": [ "alt+shift+plus" ] },
        { "command": "unbound", "keys": [ "alt+down" ] },
        { "command": "unbound", "keys": [ "alt+left" ] },
        { "command": "unbound", "keys": [ "alt+right" ] },
        { "command": "unbound", "keys": [ "alt+up" ] },
        { "command": "unbound", "keys": [ "alt+shift+down" ] },
        { "command": "unbound", "keys": [ "alt+shift+left" ] },
        { "command": "unbound", "keys": [ "alt+shift+right" ] },
        { "command": "unbound", "keys": [ "alt+shift+up" ] }
    ]

I also have the same issue. Do we have to unbind the keys for tmux to work? And what about mouse-focus? Prior to this release, in tmux clicking with mouse on any pane would focus the cursor in that pane. Now apparently that's gone. How does one restore mouse clicky behaviour ?

@zadjii-msft
Copy link
Member

I'm confident that clicking in a pane in tmux never worked in the Windows Terminal, since we don't yet support mouse mode (#376, #545)...

@sivaramn
Copy link

I'm confident that clicking in a pane in tmux never worked in the Windows Terminal, since we don't yet support mouse mode (#376, #545)...

thanks for that. I could be mistaken, as I use versions of tmux in wsl & cygwin using mintty.

And the key unbounding didn't work. I'm still not able to use the alt keys to switch panes

@zadjii-msft
Copy link
Member

@sivaramn what exactly do you have in your profiles.json, and what's in your tmux.conf?

@sivaramn
Copy link

bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
bind -n S-Left  previous-window
bind -n S-Right next-window

that's in .tmux.conf

in profiles.json

 // Add any keybinding overrides to this array.
    // To unbind a default keybinding, set the command to "unbound"
    "keybindings": [{ "unbound": "nextTab", "keys": ["ctrl+tab"] },
		    {"command": "paste","keys": ["shift+insert"]},
		    //{ "keys": ["shift+insert"], "command": "paste" },
                    { "keys": ["ctrl+shift+v"], "command": "paste" },
		    { "command": "unbound", "keys": [ "alt+shift+-" ] },
       		    { "command": "unbound", "keys": [ "alt+shift+plus" ] },
       		    { "command": "unbound", "keys": [ "alt+down" ] },
       		    { "command": "unbound", "keys": [ "alt+left" ] },
                    { "command": "unbound", "keys": [ "alt+right" ] },
                    { "command": "unbound", "keys": [ "alt+up" ] },
                    { "command": "unbound", "keys": [ "alt+shift+down" ] },
                    { "command": "unbound", "keys": [ "alt+shift+left" ] },
                    { "command": "unbound", "keys": [ "alt+shift+right" ] },
                    { "command": "unbound", "keys": [ "alt+shift+up" ] }
			
                   ]
}

@DHowett-MSFT DHowett-MSFT removed the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Dec 10, 2019
@samba2
Copy link

samba2 commented Dec 11, 2019

...
       		    { "command": "unbound", "keys": [ "alt+down" ] },
       		    { "command": "unbound", "keys": [ "alt+left" ] },
                    { "command": "unbound", "keys": [ "alt+right" ] },
                    { "command": "unbound", "keys": [ "alt+up" ] },
                    { "command": "unbound", "keys": [ "alt+shift+down" ] },
                    { "command": "unbound", "keys": [ "alt+shift+left" ] },
                    { "command": "unbound", "keys": [ "alt+shift+right" ] },
                    { "command": "unbound", "keys": [ "alt+shift+up" ] }
                   ]
}

Just want do confirm that unbinding the alt key bindings worked for me. tmux resizing is now working as expected.

@demfabris
Copy link

Thank you so much for this!
This is an issue with Tmux alt key commands too.

@finlaybob
Copy link

Thanks for the example keybindings. Adding the unbound entries helped with behaviour in micro, which uses "alt+direction" by default for moving word at a time.

@paulwhiting
Copy link
Author

Reopening issue because my alt-arrow buttons stopped working after upgrading Terminal to 0.10.761.0.

Windows build number: 10.0.18363.720
Windows Terminal version: 0.10.761.0

Any other software?

  • Ubuntu 16.04.6 LTS
  • byobu version 5.106
  • tmux 2.1

@paulwhiting paulwhiting reopened this Mar 18, 2020
@DHowett-MSFT
Copy link
Contributor

Yep, fair enough. Bet we broke this with VT input tunneling.

@DHowett-MSFT DHowett-MSFT added Area-Input Related to input processing (key presses, mouse, etc.) Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-1 A description (P1) Product-Terminal The new Windows Terminal. labels Mar 18, 2020
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Mar 18, 2020
@DHowett-MSFT
Copy link
Contributor

Actually, no, I think we broke unbinding. /cc @zadjii-msft.

@DHowett-MSFT DHowett-MSFT changed the title Alt arrow keys do nothing Alt arrow keys do nothing; key unbinding broken? Mar 18, 2020
@DHowett-MSFT DHowett-MSFT added this to the Terminal v1.0 milestone Mar 18, 2020
@DHowett-MSFT DHowett-MSFT pinned this issue Mar 18, 2020
@yveslange
Copy link

Same issue :)
ALT-LEFT, RIGHT, TOP, DOWN does not react. Really feel that the "unbounds" are not working anymore.

@zadjii-msft zadjii-msft self-assigned this Mar 18, 2020
@zadjii-msft
Copy link
Member

looking now

@ghost ghost added the In-PR This issue has a related PR label Mar 18, 2020
@ghost ghost added the Needs-Tag-Fix Doesn't match tag requirements label Mar 18, 2020
zadjii-msft added a commit that referenced this issue Mar 18, 2020
## Summary of the Pull Request

We (the royal "we") broke key unbinding in #4746. We didn't run the local tests after this, which actually would have caught this. The comment even suggests what we should have done here. We need to make sure that when we bail, it's because there's a parsing function that returned nothing. `null`, `"unbound"`, etc actually don't even have a parsing function at all, so they should just keep on keepin' on.

## References

Source of this regression: #4746

## PR Checklist
* [x] Closes #3729
* [x] I work here
* [x] Tests added/passed
* [n/a] Requires documentation to be updated

## Detailed Description of the Pull Request / Additional comments

This is a great example of why your unittests should run in CI always

## Validation Steps Performed
* **ran the tests**
* tested the following unbindings:

```json
        { "command": null, "keys": [ "ctrl+shift+t" ] },
        { "command": "unbound", "keys": [ "ctrl+shift+t" ] },
        { "command": "null", "keys": [ "ctrl+shift+t" ] },

```
and they each individually worked.
@ghost ghost added Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. and removed In-PR This issue has a related PR labels Mar 18, 2020
DHowett-MSFT pushed a commit that referenced this issue Mar 19, 2020
## Summary of the Pull Request

We (the royal "we") broke key unbinding in #4746. We didn't run the local tests after this, which actually would have caught this. The comment even suggests what we should have done here. We need to make sure that when we bail, it's because there's a parsing function that returned nothing. `null`, `"unbound"`, etc actually don't even have a parsing function at all, so they should just keep on keepin' on.

## References

Source of this regression: #4746

## PR Checklist
* [x] Closes #3729
* [x] I work here
* [x] Tests added/passed
* [n/a] Requires documentation to be updated

## Detailed Description of the Pull Request / Additional comments

This is a great example of why your unittests should run in CI always

## Validation Steps Performed
* **ran the tests**
* tested the following unbindings:

```json
        { "command": null, "keys": [ "ctrl+shift+t" ] },
        { "command": "unbound", "keys": [ "ctrl+shift+t" ] },
        { "command": "null", "keys": [ "ctrl+shift+t" ] },

```
and they each individually worked.

(cherry picked from commit 8211ed9)
@DHowett-MSFT DHowett-MSFT unpinned this issue Mar 24, 2020
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Mar 24, 2020
@onefuncman
Copy link

onefuncman commented May 27, 2020

Why is this the default behavior? Seems like a bad UX -- what's the tradeoff?

edit: nevermind, i see the conflict with Panes functionality now

@zadjii-msft
Copy link
Member

You know, you've just inspired an idea - if the user has no panes, then the Terminal could probably pass the Alt+Arrow through, similar to the way that Ctrl+C for copy sends a ^C when there's no text selected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Input Related to input processing (key presses, mouse, etc.) Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-1 A description (P1) Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants