-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Add keybinding: moveTabLeft, moveTabRight #3593
Comments
I don't hate this idea. With #3391 merged, we could probably make the { "keys": [ "alt+1" ], "command": { "action": "moveTab", "direction": "left" } },
{ "keys": [ "alt+2" ], "command": { "action": "moveTab", "direction": "right" } },
{ "keys": [ "alt+3" ], "command": { "action": "moveTab", "direction": "left", "amount": 1000 } },
{ "keys": [ "alt+4" ], "command": { "action": "moveTab", "direction": "right", "amount": 3 } }, I don't know why someone would necessarily want to be able to move by a custom amount, but the Alt+3 binding above could be used to move a tab all the way to the first position, so that's an idea. |
I'm not sure what the I have set up keybindings for navigating tabs as: "keybindings": [
{ "command": "prevTab", "keys": ["ctrl+pageup"] },
{ "command": "nextTab", "keys": ["ctrl+pagedown"] }
] I would ❤️ to setup something similar to move tabs in the same manner. "keybindings": [
{ "command": "prevTab", "keys": ["ctrl+pageup"] },
{ "command": "nextTab", "keys": ["ctrl+pagedown"] },
{ "command": "moveTabBackward", "keys": ["ctrl+shift+pageup"] },
{ "command": "moveTabForward", "keys": ["ctrl+shift+pagedown"] }
] I do not think that it should cycle through. Rather moving a tab backwards (in LTR languages) should stop at position The reason for using |
@dotnetCarpenter Although I don't believe we'll ever see an RTL layout for the terminal (coming from a Hebrew user here), it's still probably a good idea to name these bindings as "forward" / "backward". |
Pls finish this proposal, move tabs left/right is one of the latest feature missing 👌, WT has almost everything, I'm waiting for this proposal too, thx WT ftv |
@zadjii-msft - I can do it. Wondering if we have issues with MRU implementation |
Thanks for volunteering! I bet that the MRU ordering definitely will need to be updated as we move the tabs around. Oh yea that'll be tricky, because after we re-order the tab, we'll need to update the indicies of every other entry in the MRU list. Though, presumably drag/dropping tabs already does this right, so we should be able to re-use that code... edit: { "command": { "action": "moveTab", "direction": "forward" } },
{ "command": { "action": "moveTab", "direction": "backward" } },
{ "command": { "action": "moveTab", "direction": "forward", "amount": 1000 } },
{ "command": { "action": "moveTab", "direction": "backward", "amount": 3 } }, |
Probably the direction should be: "forward", "backward", "front", "back". |
Earlier in this thread was written this:
So to be able to move a tab to the first/last position. |
I guess that does raise good points. Does I suppose it does make more sense to start with a |
I think As you propose, much better would be to add a bool flag, which indicates a move to the front/back position and would be good to have the flag with one name, I can't find a good English word for this flag, something that describes the beginning and the end in one word. |
A good start is to implement the basic functionality and this can be added and decided later ( moving to the first/last position ), it is not so important. |
OK. I will start with a basic functionality of moving one tab left/right - let's see if I even succeed 😊 |
Currently reordering is implemented but only with the mouse, so I would start to look at which functions are used in dragStart / dragEnd handlers, investigate how they work, then look how are implemented keyboard actions, then I would create empty keyboard action and try to reuse logic and functions from dragStart / dragEnd handlers. 😁 |
Thx, I'm happy about this 👌 |
Happy to see this in Windows Terminal v1.6.10571.0 today! 🎉 Thanks @Don-Vito! |
I tested it now and works great, I like it, but 😀 the animation is painfully slow, it takes more than a second. When I do a quick reorder, then the animation is not applied, this is ok. |
Description of the new feature/enhancement
The list of implemented keybindings is missing the option of moving tabs to the left/right.
I did try and look for this request in other places, but the closest I could find was PR #3478, which implements this functionality as mouse-input by drag & drop, but as far as I could tell it is still missing as keyboard shortcuts.
I saw this mentioned in another thread, but again I was not able to tell if this was just proposed as a request or actually solved.
Proposed technical implementation details (optional)
This should be straightforward: Get the keywords
moveTabLeft
andmoveTabRight
in to the list of supported keybindings.The text was updated successfully, but these errors were encountered: