Home Adding draggable tabs to the Windows Terminal
Post
Cancel

Adding draggable tabs to the Windows Terminal

I’m a massive fan of the work the team’s been doing on WSL and the new Windows Terminal and I am a complete convert.. decades of muscle memory has been retrained to type term instead of cmd or PowerShell into my run prompt on Windows and I’m way happier.

(Ed 2/23/2020: thanks to Mark Osborn who pointed out that you can now use wt and even type in the address bar of explorer to get a terminal for a particular folder)

One of the features I really like is support for tabs enabling multiple terminals in the same window, something I do all the time on the Mac.

At Ignite 2019, Paul and I were doing a talk about the future of WIndows App development and one of our speaking points related to WinUI 2 and XAML Islands in Win32; specifically how the Windows Terminal team is using WinUI and the TabView control to enabled tabbed content. We wanted to do a demo of this in our session and show how one of the features available in the box (drag and drop reordering) was available “for free”. Turns out that draggable tabs in the terminal was not a thing. Queue sad trombone.

I didn’t get a chance to look into why this was prior to giving the talk but afterward I had a bit of downtime between slots manning the WinUI booth and decided to take a crack at solving this. Turns out it was suprisingly easy, largely thanks to said built in support in the XAML control which you can see from the diff.

Got a demo up and running and sent a video of this to Kayla and crew

tweet

who encouraged me to get a PR in which i duly did

And voila.

tabreordering

The power of opensource!

Was great to get this into the https://devblogs.microsoft.com/commandline/windows-terminal-preview-v0-7-release. I already know the feature I’m adding next :-)

This post is licensed under CC BY 4.0 by the author.