How to change New Tab and Close Tab Keyboard Shortcuts in Windows Terminal

How to change New Tab and Close Tab Keyboard Shortcuts in Windows Terminal

So I've been using Windows Terminal increasingly.

One of the first thing I noticed was that the default keyboard shortcut for open new tab is ctrl+shift+t and the default keyboard shortcut for close tab is ctrl+shift+w.

There are reasons why they chose these shortcuts. For one thing it is consistent with their keyboard shortcuts for opening new types of tab.

Open new tab

However, I use so many applications such as Chrome whose keyboard shortcut for opening a new tab is ctrl+t and closing a tab ctrl+w that it has become my preferred behaviour.

It is a massive achievement to the Windows Terminal team for making the tool so customisable that it is an extremely simple affair to provide your own keyboard shortcuts.

To do so go to Windows Terminal Settings (ctrl + ,) or click the following..

Windows Terminal Settings

And you should see the settings.json file as seen below in VSCode.

Settings.json

You can then refer to the following url that shows the key bindings that can be overridden and find newTab and closeTab (among others) and provide the values as show in the image above.

https://docs.microsoft.com/en-us/windows/terminal/customize-settings/key-bindings

Once the settings.json file is saved, the new keyboard shortcuts take effect immediately without the need of restarting Windows Terminal. Amazing.

Reading a recent blog post regarding what is available in the preview of Windows Terminal 1.1 makes me think the future of this tool is a bright one.

https://devblogs.microsoft.com/commandline/windows-terminal-preview-1-1-release/

Hope you found this useful.

-- Lee

要查看或添加评论,请登录

社区洞察

其他会员也浏览了