Add the "Move Tab to New Window" item to the context menu of the tabs #19655

Closed
opened 2026-01-31 06:49:48 +00:00 by claunia · 37 comments
Owner

Originally created by @zadjii-msft on GitHub (Apr 6, 2023).

          Is it supposed to add the "Move Tab to New Window" item to the context menu of the tabs

Screenshot_2023-04-06_08-54-54
like Mozilla Firefox
Screenshot_2023-04-06_08-55-44
in the context of this task?

Screenshots of Windows Terminal Preview 1.17.1023 and Mozilla Firefox 111.0.1 (64-bit), Microsoft Windows 10.0.19045.2788.

Originally posted by @Korb in https://github.com/microsoft/terminal/issues/1256#issuecomment-1498541375

Originally created by @zadjii-msft on GitHub (Apr 6, 2023). Is it supposed to add the "Move Tab to New Window" item to the context menu of the tabs ![Screenshot_2023-04-06_08-54-54](https://user-images.githubusercontent.com/3509797/230285656-909af440-5b8a-4d98-91cd-e72b8d4feaf4.png) like Mozilla Firefox ![Screenshot_2023-04-06_08-55-44](https://user-images.githubusercontent.com/3509797/230285863-db1a8f4d-f1ca-44b5-96d3-eca158e30f37.png) in the context of this task? Screenshots of Windows Terminal Preview 1.17.1023 and Mozilla Firefox 111.0.1 (64-bit), Microsoft Windows 10.0.19045.2788. _Originally posted by @Korb in https://github.com/microsoft/terminal/issues/1256#issuecomment-1498541375_
Author
Owner

@Jaswir commented on GitHub (May 11, 2023):

Want to tackle my first issue for this project.
Having trouble getting the project build in visual studio which I need to Run & Debug.

I installed all the prerequisites as described in README as far as I know.
And am able to build it with Powershell.

Had some trouble with Configuration manager when first opening the project in Visual Studio.
https://stackoverflow.com/questions/72852490/current-solution-contains-incorrect-configuration-mappings

Cleared everything between
GlobalSection(ProjectConfigurationPlatforms) = postSolution
and
EndGlobalSection

For the OpenConsole.sln file.

Properties for Cascadia Package have been set in the Debug menu to "Native Only" for "Application process" and "Background task process".

x64 Platform has been selected.

This is what I get:
image

I tried x86 , makes no difference.
Turned off Windows Defender, doesn't make a difference
https://stackoverflow.com/questions/16680717/error-msb6006-mt-exe-exited-with-code-31

@Jaswir commented on GitHub (May 11, 2023): Want to tackle my first issue for this project. Having trouble getting the project build in visual studio which I need to Run & Debug. I installed all the prerequisites as described in README as far as I know. And am able to build it with Powershell. Had some trouble with Configuration manager when first opening the project in Visual Studio. https://stackoverflow.com/questions/72852490/current-solution-contains-incorrect-configuration-mappings Cleared everything between `GlobalSection(ProjectConfigurationPlatforms) = postSolution` and `EndGlobalSection` For the OpenConsole.sln file. Properties for Cascadia Package have been set in the Debug menu to "Native Only" for "Application process" and "Background task process". x64 Platform has been selected. This is what I get: ![image](https://github.com/microsoft/terminal/assets/15957528/e70c8464-6336-4f87-a760-73fe3b389ad8) I tried x86 , makes no difference. Turned off Windows Defender, doesn't make a difference https://stackoverflow.com/questions/16680717/error-msb6006-mt-exe-exited-with-code-31
Author
Owner

@zadjii-msft commented on GitHub (May 11, 2023):

Oh you can almost certainly ignore the warning that VS shows about the incorrect configurations. I'd revert all your changes to OpenConsole.sln, then make sure you pick:

And that should just work.

Our sln is a crazy hodgepodge of c++ and C# code and unsurprisingly, VS does not care for that 😅

Lemme know if you run into any other issues

@zadjii-msft commented on GitHub (May 11, 2023): Oh you can almost certainly ignore the warning that VS shows about the incorrect configurations. I'd revert all your changes to `OpenConsole.sln`, then make sure you pick: ![](https://github.com/microsoft/terminal/assets/18356694/e656f2da-0584-46c7-a30a-1f230ceb7555) And that should just work. Our sln is a crazy hodgepodge of c++ and C# code and unsurprisingly, VS _does not care for that_ 😅 Lemme know if you run into any other issues
Author
Owner

@Jaswir commented on GitHub (May 12, 2023):

@zadjii-msft

Reverted all changes to OpenConsole.sln by removing and recloning the project.

Picked:
image

Restored and updated submodules
git submodule update --init --recursive

Ignored warning about incorrect configurations.
In the Debug menu, I changed "Application process" and "Background task process" to "Native Only".

Build it, had an issue with nuget packages:

Nuget Package Restore 2023-05-12 114632

Solved that by building with Powershell. This installed the packages, but this time build ended with errors.
Afterwards I deleted the Obj and Bin folder of the project and build it with visual studio, getting the same erros as before, but getting similar errors with PowerShell now as well:

Same Errors

image

image

@Jaswir commented on GitHub (May 12, 2023): @zadjii-msft Reverted all changes to OpenConsole.sln by removing and recloning the project. Picked: ![image](https://github.com/microsoft/terminal/assets/15957528/ca89bc94-5d40-44a2-90ec-b8788920fa89) Restored and updated submodules `git submodule update --init --recursive` Ignored warning about incorrect configurations. In the Debug menu, I changed "Application process" and "Background task process" to "Native Only". Build it, had an issue with nuget packages: ![Nuget Package Restore 2023-05-12 114632](https://github.com/microsoft/terminal/assets/15957528/bb571cc4-d0e2-4dc8-af4f-a2bdbaa517f3) Solved that by building with Powershell. This installed the packages, but this time build ended with errors. Afterwards I deleted the Obj and Bin folder of the project and build it with visual studio, getting the same erros as before, but getting similar errors with PowerShell now as well: ![Same Errors ](https://github.com/microsoft/terminal/assets/15957528/756c0f6f-9c8f-4a97-a0cb-4a8826c9b832) ![image](https://github.com/microsoft/terminal/assets/15957528/86c86eb9-a103-4084-8717-b56e4724855f) ![image](https://github.com/microsoft/terminal/assets/15957528/181aca8a-fd23-40a9-b211-b2b3726711a4)
Author
Owner

@zadjii-msft commented on GitHub (May 12, 2023):

(_ConsoIeGenerateAdditionaIWinmdManifests target) —>
    mt.exe: command line error c1010007: Unexpected/ Unknown option "...\Microsoft.Termina1.Control\Microsoft.Terminal.Control.winmd". Use the / ? option for help on usage and samples. 
    The command `mt.exe -winmd:...\Termina1.Control\Microsoft.Terminal.Control.winmd -dll:Microsoft.Terminal.Control.dll -out:...WindowsTerminal\Microsoft.Terminal.Control.manifest exited with code 31

Huh. I've literally never seen that before. That'll require some searching.

When you built it from the command-line the first time, it worked and you didn't run into that?

Utterly bewildering.

@zadjii-msft commented on GitHub (May 12, 2023): ``` (_ConsoIeGenerateAdditionaIWinmdManifests target) —> mt.exe: command line error c1010007: Unexpected/ Unknown option "...\Microsoft.Termina1.Control\Microsoft.Terminal.Control.winmd". Use the / ? option for help on usage and samples. The command `mt.exe -winmd:...\Termina1.Control\Microsoft.Terminal.Control.winmd -dll:Microsoft.Terminal.Control.dll -out:...WindowsTerminal\Microsoft.Terminal.Control.manifest exited with code 31 ``` Huh. I've literally never seen that before. That'll require some searching. When you built it from the command-line the first time, it worked and you didn't run into that? Utterly bewildering.
Author
Owner

@ianjoneill commented on GitHub (May 12, 2023):

Silly question - does the username covered up with the blue splodge contain any odd characters - like a space?

@ianjoneill commented on GitHub (May 12, 2023): Silly question - does the username covered up with the blue splodge contain any odd characters - like a space?
Author
Owner

@Jaswir commented on GitHub (May 12, 2023):

@ianjoneill

Yes It contains a space.

Update 1:
I tried building with Powershell in two separate locations one in my User folder, the other in C:.
In C: I don't get the mt.exe errors Getting Nuget package restore errors so that's an improvement :)
Thanks.

Update 2 :

image

@Jaswir commented on GitHub (May 12, 2023): @ianjoneill Yes It contains a space. Update 1: I tried building with Powershell in two separate locations one in my User folder, the other in C:. In C: I don't get the mt.exe errors Getting Nuget package restore errors so that's an improvement :) Thanks. Update 2 : ![image](https://github.com/microsoft/terminal/assets/15957528/9ede8f1e-5898-4c3e-ab1e-3a9505ab1ed3)
Author
Owner

@Jaswir commented on GitHub (May 12, 2023):

@ianjoneill @zadjii-msft

Got it running in VS thanks very much to @ianjoneill !
and @zadjii-msft for the configuration Manager ignore tip.
image

@Jaswir commented on GitHub (May 12, 2023): @ianjoneill @zadjii-msft Got it running in VS thanks very much to @ianjoneill ! and @zadjii-msft for the configuration Manager ignore tip. ![image](https://github.com/microsoft/terminal/assets/15957528/1e92ed1a-0611-49fb-93d7-9690c1c16a28)
Author
Owner

@Jaswir commented on GitHub (May 12, 2023):

@zadjii-msft @ianjoneill

“That'll require some searching.”
Would you have done that? What is like protocol in this Open Source project in terms of help you can expect from Members ?

Can I expect you to do the searching. Or is it more like you expect me to do the searching and try various different things. And I can expect a small hint here and there?

PS: I'll get to picking up this issue now I got Debugger working.

@Jaswir commented on GitHub (May 12, 2023): @[zadjii-msft](https://github.com/zadjii-msft) @[ianjoneill](https://github.com/ianjoneill) “That'll require some searching.” Would you have done that? What is like protocol in this Open Source project in terms of help you can expect from Members ? Can I expect you to do the searching. Or is it more like you expect me to do the searching and try various different things. And I can expect a small hint here and there? PS: I'll get to picking up this issue now I got Debugger working.
Author
Owner

@zadjii-msft commented on GitHub (May 12, 2023):

“That'll require some searching.”
Would you have done that?

I mean, yea? I was planning on trying to look into that error myself if you couldn't figure it out. Pretty much my biggest priority is helping keep folks unblocked. I'm all for giving hints - heck, I've got an entire project board full of "walkthroughs" I've written for issues: https://aka.ms/terminal-walkthroughs.

Speaking of which, I should probably write one for this issue too!

@zadjii-msft commented on GitHub (May 12, 2023): > “That'll require some searching.” > Would you have done that? I mean, yea? I was planning on trying to look into that error myself if you couldn't figure it out. Pretty much my biggest priority is helping keep folks unblocked. I'm all for giving hints - heck, I've got an entire project board full of "walkthroughs" I've written for issues: https://aka.ms/terminal-walkthroughs. Speaking of which, I should probably write one for this issue too!
Author
Owner

@zadjii-msft commented on GitHub (May 12, 2023):

Note

Walkthrough

  • I'd start by looking at TerminalTab::_CreateContextMenu. That's where we set up the tab context menu.
  • Almost all the buttons work by triggering a WINRT_CALLBACK, which is ultimately handled by a handler set up in TerminalPage::_InitializeTab (in TabManagement.cpp)
  • To actually do the moving, you'll want to build a MoveTabArgs with the Window set to "new".
    • You'll want to then call TerminalPage._MoveTab
  • The trick here will be being able to move an unfocused tab. "Find" has a similar issue. It might be a sensible place to do a page->_SetFocusedTab(*tab); first, to manually focus that tab.
@zadjii-msft commented on GitHub (May 12, 2023): > **Note** > ## Walkthrough * I'd start by looking at `TerminalTab::_CreateContextMenu`. That's where we set up the tab context menu. * Almost all the buttons work by triggering a `WINRT_CALLBACK`, which is ultimately handled by a handler set up in `TerminalPage::_InitializeTab` (in `TabManagement.cpp`) * To actually do the moving, you'll want to build a `MoveTabArgs` with the `Window` set to `"new"`. * You'll want to then call `TerminalPage._MoveTab` * The trick here will be being able to move an unfocused tab. "Find" has a similar issue. It might be a sensible place to do a `page->_SetFocusedTab(*tab);` first, to manually focus that tab.
Author
Owner

@Jaswir commented on GitHub (May 15, 2023):

@zadjii-msft Your walkthroughs look really cool, in the sense that you build it like a game!! I love that.

Btw, the software not being able to be build when someone has a username that contains a space. This may be a new issue? If so, I could make a new issue for it.
Can't help but being bugged by not having the project in my preferable location.

@Jaswir commented on GitHub (May 15, 2023): @zadjii-msft Your walkthroughs look really cool, in the sense that you build it like a game!! I love that. Btw, the software not being able to be build when someone has a username that contains a space. This may be a new issue? If so, I could make a new issue for it. Can't help but being bugged by not having the project in my preferable location.
Author
Owner

@Jaswir commented on GitHub (May 15, 2023):

Made some progress, got the UI part done.
UI_Part_done_mostly

Button will need a new Glyph though. I assume you have like an artist for that?

Still need to build the functionality, currently duplicates duplicate tab functionality.

@Jaswir commented on GitHub (May 15, 2023): Made some progress, got the UI part done. ![UI_Part_done_mostly](https://github.com/microsoft/terminal/assets/15957528/edefc48a-a109-4de2-a6f7-7182e2b45558) Button will need a new Glyph though. I assume you have like an artist for that? Still need to build the functionality, currently duplicates duplicate tab functionality.
Author
Owner

@Jaswir commented on GitHub (May 15, 2023):

I started exploring the code base a bit and have some questions:

Where are cpp files inside solution explorer, like where is TerminalTab.cpp?
Can find it in file explorer, but not solution explorer. Is this a cpp thing or? (more used to c#)
And if it is there, how can I find it? I remember something about shortcuts for that, but not sure.

where_are_cpp_files_inside_solution_explorer
but_inside_file_explorer

@Jaswir commented on GitHub (May 15, 2023): I started exploring the code base a bit and have some questions: Where are cpp files inside solution explorer, like where is TerminalTab.cpp? Can find it in file explorer, but not solution explorer. Is this a cpp thing or? (more used to c#) And if it is there, how can I find it? I remember something about shortcuts for that, but not sure. ![where_are_cpp_files_inside_solution_explorer](https://github.com/microsoft/terminal/assets/15957528/9a42810e-68ff-472e-aac1-868976d36c08) ![but_inside_file_explorer](https://github.com/microsoft/terminal/assets/15957528/48807902-fc3e-4a51-a31c-0509806b38e3)
Author
Owner

@Jaswir commented on GitHub (May 16, 2023):

Functionality added, here's the preview:
Functionality_done_onto_commit

Will be working towards pull request.

@Jaswir commented on GitHub (May 16, 2023): Functionality added, here's the preview: ![Functionality_done_onto_commit](https://github.com/microsoft/terminal/assets/15957528/79e81d54-3600-42d2-9cf6-8bc00ad828ac) Will be working towards pull request.
Author
Owner

@zadjii-msft commented on GitHub (May 17, 2023):

That looks great!

Presumably you figured it out, but the .cpp files are nested under the .h files (usually). Some of them are nested under the .idl's or .xaml's. Honestly, I don't know why VS chooses to do it that way 🤷 I've honestly only ever used the "Go to files" shortcut (which I think is sound to ctrl+shift+t) in VS. Way easier than trying to navigate the project structure. Just type bits of the file name and go. But then again, I'm more of a Sublime / VsCode user than a VS one - I just use big VS for building and debugging 😆

@zadjii-msft commented on GitHub (May 17, 2023): That looks great! Presumably you figured it out, but the .cpp files are nested under the .h files (usually). Some of them are nested under the .idl's or .xaml's. Honestly, I don't know why VS chooses to do it that way 🤷 I've honestly only ever used the "Go to files" shortcut (which I think is sound to <kbd>ctrl+shift+t</kbd>) in VS. **Way** easier than trying to navigate the project structure. Just type bits of the file name and go. But then again, I'm more of a Sublime / VsCode user than a VS one - I just use big VS for building and debugging 😆
Author
Owner

@Jaswir commented on GitHub (May 17, 2023):

@zadjii-msft

image

What do you mean with TerminalApp? The code files named TerminalApp? Like TerminalApp.h, TerminalApp.cs
Or files in the TerminalApp Project inside the VS Solution?
This one, see below
image

@Jaswir commented on GitHub (May 17, 2023): @zadjii-msft ![image](https://github.com/microsoft/terminal/assets/15957528/879f5a87-d458-456f-876d-687bd1d9617a) What do you mean with TerminalApp? The code files named TerminalApp? Like TerminalApp.h, TerminalApp.cs Or files in the TerminalApp Project inside the VS Solution? This one, see below ![image](https://github.com/microsoft/terminal/assets/15957528/4b850dcd-efb1-47d2-897b-6ba7c7e89218)
Author
Owner

@Jaswir commented on GitHub (May 17, 2023):

@zadjii-msft

!! Making sure you notice it needs a different Glyph, currently uses the Duplicate glyph.
I assume you have like an artist for that?

@Jaswir commented on GitHub (May 17, 2023): @zadjii-msft !! Making sure you notice it needs a different Glyph, currently uses the Duplicate glyph. I assume you have like an artist for that?
Author
Owner

@zadjii-msft commented on GitHub (May 17, 2023):

Ah yea - those are probably a little out of date. But yea TerminalApp in that context means "The TerminalApp project". Which these days is probably more accurately "anything that uses C++/WinRT".

I'd honestly just use one of the following two icons from the built-in Segoe Fluent Icons

Glyph Unicode point Description
image e8a7 OpenInNewWindow
image e78b NewWindow

OpenInNewWindow looks good to me.

@zadjii-msft commented on GitHub (May 17, 2023): Ah yea - those are probably a little out of date. But yea `TerminalApp` in that context means "The `TerminalApp` project". Which these days is probably more accurately "anything that uses C++/WinRT". I'd honestly just use one of the following two icons from the built-in [Segoe Fluent Icons](https://learn.microsoft.com/en-us/windows/apps/design/style/segoe-fluent-icons-font) Glyph | Unicode point | Description -- | -- | -- ![image](https://github.com/microsoft/terminal/assets/18356694/df036f97-0996-4090-a003-f2adf2ad42de) | e8a7 | OpenInNewWindow ![image](https://github.com/microsoft/terminal/assets/18356694/c1e1a82d-48ab-4e11-b6b5-5c3810270d57) | e78b | NewWindow `OpenInNewWindow` looks good to me.
Author
Owner

@Jaswir commented on GitHub (May 17, 2023):

@zadjii-msft

I Noticed you hadn't commented for a couple days. When are you available to respond to questions? Do you have certain days you are working on this project?

@Jaswir commented on GitHub (May 17, 2023): @zadjii-msft I Noticed you hadn't commented for a couple days. When are you available to respond to questions? Do you have certain days you are working on this project?
Author
Owner

@Jaswir commented on GitHub (May 17, 2023):

@zadjii-msft

Did the Pull Request.

By contributing to this Open Source Project. I intend to become a better Engineer. Would appreciate any tips/advice you can give.

Let me know if something need to be changed.

@Jaswir commented on GitHub (May 17, 2023): @zadjii-msft Did the Pull Request. By contributing to this Open Source Project. I intend to become a better Engineer. Would appreciate any tips/advice you can give. Let me know if something need to be changed.
Author
Owner

@Jaswir commented on GitHub (May 18, 2023):

@zadjii-msft

I really appreciate the time and effort you took to write the Walkthrough for this.

But that made it way too easy for me.
Big part of the fun for me in solving these "programming puzzles"/bugs/features etc. is the detective work.
Looking for the files to adapt and what specific piece of code I need to adapt.
And pointing out the specific files and even the methods especially took the fun out of it.

In the future I would very much like less hand holding.
That being said I am still new to c++ so don't go overboard.

@Jaswir commented on GitHub (May 18, 2023): @zadjii-msft I really appreciate the time and effort you took to write the Walkthrough for this. But that made it way too easy for me. Big part of the fun for me in solving these "programming puzzles"/bugs/features etc. is the detective work. Looking for the files to adapt and what specific piece of code I need to adapt. And pointing out the specific files and even the methods especially took the fun out of it. In the future I would very much like less hand holding. That being said I am still new to c++ so don't go overboard.
Author
Owner

@Jaswir commented on GitHub (May 18, 2023):

@zadjii-msft

About your second point.
image

I don't get point 2:
"using the active profile in the current directory."
I interpreted this to mean that the current tab information (active profile in current directory) is used for the tab you want to move. And so you don't create a new tab, but move the current tab (using the active profile in the current directory) to the new window.

I have looked at it and on further inspection Duplicate Tab doesn't work how I expected it to work...
Duplicate_Not_working_As_Expected_Question_mark

Duplicate just creates a tab with same terminal type e.g. Powershell
But what I expect is an actually duplicated tab, so this:

image

@Jaswir commented on GitHub (May 18, 2023): @zadjii-msft About your second point. ![image](https://github.com/microsoft/terminal/assets/15957528/d9018b8c-1fbf-4f89-8ef4-8890cd120633) I don't get point 2: "using the active profile in the current directory." I interpreted this to mean that the current tab information (active profile in current directory) is used for the tab you want to move. And so you don't create a new tab, but move the current tab (using the active profile in the current directory) to the new window. I have looked at it and on further inspection Duplicate Tab doesn't work how I expected it to work... ![Duplicate_Not_working_As_Expected_Question_mark](https://github.com/microsoft/terminal/assets/15957528/981bcb9e-9c2a-45a5-8512-aff0aa2ceb0a) Duplicate just creates a tab with same terminal type e.g. Powershell But what I expect is an actually duplicated tab, so this: ![image](https://github.com/microsoft/terminal/assets/15957528/dc0a2ae3-cb50-4d7e-b720-208b8041c0b9)
Author
Owner

@Jaswir commented on GitHub (May 18, 2023):

@zadjii-msft

Actually, why is, the duplicate not working like that?
Or am I saying something really silly.

Not sure about why duplicating would be useful. Don't think I often do that for a terminal window.

PS: Have been getting a bit more into windows terminal lately. Check out this pimp:

image

@Jaswir commented on GitHub (May 18, 2023): @zadjii-msft Actually, why is, the duplicate not working like that? Or am I saying something really silly. Not sure about why duplicating would be useful. Don't think I often do that for a terminal window. PS: Have been getting a bit more into windows terminal lately. Check out this pimp: ![image](https://github.com/microsoft/terminal/assets/15957528/4b8dc8c1-6761-4d25-bf53-51fef635b7f8)
Author
Owner

@Jaswir commented on GitHub (May 18, 2023):

@zadjii-msft

That looks great!

Presumably you figured it out, but the .cpp files are nested under the .h files (usually). Some of them are nested under the .idl's or .xaml's. Honestly, I don't know why VS chooses to do it that way 🤷 I've honestly only ever used the "Go to files" shortcut (which I think is sound to ctrl+shift+t) in VS. Way easier than trying to navigate the project structure. Just type bits of the file name and go. But then again, I'm more of a Sublime / VsCode user than a VS one - I just use big VS for building and debugging 😆

Hadn't figured it out yet. Thanks! I am familiar with the ctrl+shift+t shortcut in VS.

So you have 2 windows open VSCode program and one VS? And then VSCode on one screen and VS on the other or?
Can you maybe show me your screen setup? I am really used to working with just VS. But I think I need to adapt. VSCode would indeed have the cpp files in the src. I know I can use ctrl+shift+t but it helps for me in my head that I can also see the file in the folder system. But the thing is if I would be looking for the files myself it would be hard in VS much easier in VSCode.

@Jaswir commented on GitHub (May 18, 2023): @zadjii-msft > That looks great! > > Presumably you figured it out, but the .cpp files are nested under the .h files (usually). Some of them are nested under the .idl's or .xaml's. Honestly, I don't know why VS chooses to do it that way 🤷 I've honestly only ever used the "Go to files" shortcut (which I think is sound to ctrl+shift+t) in VS. **Way** easier than trying to navigate the project structure. Just type bits of the file name and go. But then again, I'm more of a Sublime / VsCode user than a VS one - I just use big VS for building and debugging 😆 Hadn't figured it out yet. Thanks! I am familiar with the ctrl+shift+t shortcut in VS. So you have 2 windows open VSCode program and one VS? And then VSCode on one screen and VS on the other or? Can you maybe show me your screen setup? I am really used to working with just VS. But I think I need to adapt. VSCode would indeed have the cpp files in the src. I know I can use ctrl+shift+t but it helps for me in my head that I can also see the file in the folder system. But the thing is if I would be looking for the files myself it would be hard in VS much easier in VSCode.
Author
Owner

@zadjii-msft commented on GitHub (May 18, 2023):

So you have 2 windows open VSCode program and one VS? And then VSCode on one screen and VS on the other or?

Basically, yea. I've got three monitors, so my typical layout looks a bit like:
image

I used Sublime for years, (and still do sometimes), so my mental model of the codebase entirely revolves around:

  • ctrl+p: go to a file in the project by name with a fuzzy match
  • ctrl+r: navigate to a function / class in this file by name
  • ctrl+g: go to a line in this file

For me, that's just become way easier than trying to navigate the file tree UI.


I don't get point 2:
"using the active profile in the current directory."
I interpreted this to mean that the current tab information (active profile in current directory) is used for the tab you want to move. And so you don't create a new tab, but move the current tab (using the active profile in the current directory) to the new window.

Ah, so, to clarify:

  • A "terminal pane" is really a combo of a bunch of state - the buffer, the connection to the client app (e.g. cmd.exe), and then any runtime state, like the tab title, CWD, etc.
  • "Duplicate tab" can't recreate the state of the buffer or the state of the connected clients. Like, if you had a tab running cmd.exe, which ran ssh, which ran vim... the Terminal can't recreate that. So we don't even bother. Instead, we just use what we do know - the profile used for that tab, the tab title, and possibly the CWD, and we create a new connection and a new buffer for that new tab.
  • "Move tab to new window" is different. It's not making a new connection or buffer - it's literally just moving the existing one. So the original text you had

    Moves tab to a new window using the active profile in the current directory

    • IMO, that has a subtle implication that the active profile and CWD will be used to make a new connection. Which isn't true - it's effectively just tearing out the current tab.

Does that all make sense? It's a real subtlety and a more confusing bit of how the Terminal works behind the scenes.


I really appreciate the time and effort you took to write the Walkthrough for this.

But that made it way too easy for me.

Thanks! To be honest, that sounds like the walkthrough did exactly it's purpose - help get you oriented in an unfamiliar codebase. Now that you've got it building and know your way around running the project locally, feel free to go tackle something a bit more challenging. I'll look forward to the PR 😄

@zadjii-msft commented on GitHub (May 18, 2023): > So you have 2 windows open VSCode program and one VS? And then VSCode on one screen and VS on the other or? Basically, yea. I've got three monitors, so my typical layout looks a bit like: ![image](https://github.com/microsoft/terminal/assets/18356694/d180d59b-3e4d-429b-b015-8e416a106062) I used Sublime for years, (and still do sometimes), so my mental model of the codebase entirely revolves around: * `ctrl+p`: go to a file in the project by name with a fuzzy match * `ctrl+r`: navigate to a function / class in this file by name * `ctrl+g`: go to a line in this file For me, that's just become way easier than trying to navigate the file tree UI. ---- > I don't get point 2: > "using the active profile in the current directory." > I interpreted this to mean that the current tab information (active profile in current directory) is used for the tab you want to move. And so you don't create a new tab, but move the current tab (using the active profile in the current directory) to the new window. Ah, so, to clarify: * A "terminal pane" is really a combo of a bunch of state - the buffer, the connection to the client app (e.g. `cmd.exe`), and then any runtime state, like the tab title, CWD, etc. * "Duplicate tab" can't recreate the state of the buffer or the state of the connected clients. Like, if you had a tab running `cmd.exe`, which ran `ssh`, which ran `vim`... the Terminal can't recreate that. So we don't even bother. Instead, we just use what we do know - the profile used for that tab, the tab title, and possibly the CWD, and we create a _new_ connection and a _new_ buffer for that new tab. * "Move tab to new window" is different. It's not making a _new_ connection or buffer - it's literally just moving the existing one. So the original text you had > Moves tab to a new window using the active profile in the current directory * IMO, that has a subtle implication that the active profile and CWD will be used to make a _new_ connection. Which isn't true - it's effectively just tearing out the current tab. Does that all make sense? It's a real subtlety and a more confusing bit of how the Terminal works behind the scenes. --- > I really appreciate the time and effort you took to write the Walkthrough for this. > > But that made it way too easy for me. Thanks! To be honest, that sounds like the walkthrough did exactly it's purpose - help get you oriented in an unfamiliar codebase. Now that you've got it building and know your way around running the project locally, feel free to go tackle something a bit more challenging. I'll look forward to the PR 😄
Author
Owner

@Jaswir commented on GitHub (May 19, 2023):

@zadjii-msft

Thanks! To be honest, that sounds like the walkthrough did exactly it's purpose - help get you oriented in an unfamiliar codebase. Now that you've got it building and know your way around running the project locally, feel free to go tackle something a bit more challenging. I'll look forward to the PR 😄

I am worried that next time I take on an issue and I ask a question, you'll provide me the filenames and specific functions again where changes need to be made. And feel like your response doesn't address my concern.

A big part of me helping out in this Open Source project is wanting to become a better Engineer. Getting pointed to the filenames and particularly the specific functions in the filename conflicts with that.

Basically the give a man a fish idea: “If you give a man a fish, you feed him for a day. If you teach a man to fish, you feed him for a lifetime.” A good Engineer is able to think for themselves, find the specific files and specific parts e.g. functions themselves.
In real life software engineering situations more often than not, there won't be someone pointing me to the filenames and functions. By having you point me to them, you are effectively doing the thinking for me. And so without that I'd be lost.

So I would like to know if it's also possible that you give me more vague hints? E.g. only point to the filename but not the functions. What kind of hints would you give to a junior / entry level engineer at Microsoft?

@Jaswir commented on GitHub (May 19, 2023): @zadjii-msft > Thanks! To be honest, that sounds like the walkthrough did exactly it's purpose - help get you oriented in an unfamiliar codebase. Now that you've got it building and know your way around running the project locally, feel free to go tackle something a bit more challenging. I'll look forward to the PR 😄 I am worried that next time I take on an issue and I ask a question, you'll provide me the filenames and specific functions again where changes need to be made. And feel like your response doesn't address my concern. A big part of me helping out in this Open Source project is wanting to become a better Engineer. Getting pointed to the filenames and particularly the specific functions in the filename conflicts with that. Basically the give a man a fish idea: “If you give a man a fish, you feed him for a day. If you teach a man to fish, you feed him for a lifetime.” A good Engineer is able to think for themselves, find the specific files and specific parts e.g. functions themselves. In real life software engineering situations more often than not, there won't be someone pointing me to the filenames and functions. By having you point me to them, you are effectively doing the thinking for me. And so without that I'd be lost. So I would like to know if it's also possible that you give me more vague hints? E.g. only point to the filename but not the functions. What kind of hints would you give to a junior / entry level engineer at Microsoft?
Author
Owner

@zadjii-msft commented on GitHub (May 19, 2023):

Ah sorry, let me be more specific: IMO, just getting the project to build and run can often be its own problem. (as you so observed!) If you want more challenging issues, I'd be all for helping point you at some of those. I've found that for myself, starting with an easy win always gets me into a better headspace for harder problems later in the day / week.

These issues: https://github.com/orgs/microsoft/projects/686/views/4 are some that I think are probably a comparable difficulty, that I've never gotten around to writing walkthroughs for yet. Basically as you go up in difficulty, the hints I can give are going to get more abstract. I can always give less hints if you'd like 😛

What kind of hints would you give to a junior / entry level engineer at Microsoft

oof that's a good question - when's the last time we even had one of those 😅 Honestly I might just point them at a similar PR or two in the past and be like "alright, this issue is a lot like #foo, and maybe a little like #bar, so do it just like those two PRs".

@zadjii-msft commented on GitHub (May 19, 2023): Ah sorry, let me be more specific: IMO, just getting the project to build and run can often be its own problem. (as you so observed!) If you want more challenging issues, I'd be all for helping point you at some of those. I've found that for myself, starting with an easy win always gets me into a better headspace for harder problems later in the day / week. These issues: https://github.com/orgs/microsoft/projects/686/views/4 are some that I think are probably a comparable difficulty, that I've never gotten around to writing walkthroughs for yet. Basically as you go up in difficulty, the hints I can give are going to get more abstract. I can always give _less_ hints if you'd like 😛 > What kind of hints would you give to a junior / entry level engineer at Microsoft oof that's a good question - when's the last time we even had one of those 😅 Honestly I might just point them at a similar PR or two in the past and be like "alright, this issue is a lot like #foo, and maybe a little like #bar, so do it just like those two PRs".
Author
Owner

@zadjii-msft commented on GitHub (May 19, 2023):

#14909 might be a good example - something similar to what you just did, so you're already familiar with the problem space. Not a ton of hints in that one either... (I can always look for others if that doesn't seem interesting 😉 )

@zadjii-msft commented on GitHub (May 19, 2023): #14909 might be a good example - something similar to what you just did, so you're already familiar with the problem space. Not a ton of hints in that one either... (I can always look for others if that doesn't seem interesting 😉 )
Author
Owner

@Jaswir commented on GitHub (May 20, 2023):

@zadjii-msft

I added you on LinkedIn. You haven't added me back, why is that?
Btw I'll get to the second issue. Looking through your no walkthrough list.

@Jaswir commented on GitHub (May 20, 2023): @zadjii-msft I added you on LinkedIn. You haven't added me back, why is that? Btw I'll get to the second issue. Looking through your no walkthrough list.
Author
Owner

@Jaswir commented on GitHub (May 20, 2023):

Basically, yea. I've got three monitors, so my typical layout looks a bit like: image

I used Sublime for years, (and still do sometimes), so my mental model of the codebase entirely revolves around:

  • ctrl+p: go to a file in the project by name with a fuzzy match
  • ctrl+r: navigate to a function / class in this file by name
  • ctrl+g: go to a line in this file

For me, that's just become way easier than trying to navigate the file tree UI.

Do you also use this for pure C# projects? I wonder, cause there the file tree UI makes way more sense in Visual Studio than cpp. Other thing I wonder about, if you work like this, then how do you keep a model in your mind of how the entire codebase is connected?

Does the Windows Terminal Open Source Project have like a map or something? That describes how the various classes are connected? With map I am thinking about a piece of paper with rectangles that are connected with lines. Where rectangles

@Jaswir commented on GitHub (May 20, 2023): > Basically, yea. I've got three monitors, so my typical layout looks a bit like: ![image](https://user-images.githubusercontent.com/18356694/239271666-d180d59b-3e4d-429b-b015-8e416a106062.png) > > I used Sublime for years, (and still do sometimes), so my mental model of the codebase entirely revolves around: > > * `ctrl+p`: go to a file in the project by name with a fuzzy match > * `ctrl+r`: navigate to a function / class in this file by name > * `ctrl+g`: go to a line in this file > > For me, that's just become way easier than trying to navigate the file tree UI. > Do you also use this for pure C# projects? I wonder, cause there the file tree UI makes way more sense in Visual Studio than cpp. Other thing I wonder about, if you work like this, then how do you keep a model in your mind of how the entire codebase is connected? Does the Windows Terminal Open Source Project have like a map or something? That describes how the various classes are connected? With map I am thinking about a piece of paper with rectangles that are connected with lines. Where rectangles
Author
Owner

@Jaswir commented on GitHub (May 20, 2023):

@zadjii-msft I like this one https://github.com/microsoft/terminal/issues/6366
Lot's of people would be happy with that contribution. Gonna take a crack at it.

@Jaswir commented on GitHub (May 20, 2023): @zadjii-msft I like this one https://github.com/microsoft/terminal/issues/6366 Lot's of people would be happy with that contribution. Gonna take a crack at it.
Author
Owner

@zadjii-msft commented on GitHub (May 22, 2023):

Do you also use this for pure C# projects? I wonder, cause there the file tree UI makes way more sense in Visual Studio than cpp

Honestly, I can't say I've written any serious production quality C#. A couple small projects here and there. An early prototype of the Terminal was C#. But noting more than a couple files. That being said, I used basically the same workflow for both C++ and my Python side projects. That way I don't really have to worry about how the project is laid out on the filesystem - as long as I know where I'm going, then it's easy enough to just pop open the file by name.

how do you keep a model in your mind of how the entire codebase is connected

image

But seriously though - I've been working through re-writes of the Console codebase for 8 years now. I helped design the architecture of the Terminal codebase itself. That's been my 9-5 for years, at this point, it's just instinct.

Does the Windows Terminal Open Source Project have like a map or something

No, but it really should. We used to have a giant wall in the office with every library we owned, the paths to the files, and how they all connected. Not sure if that survived in Redmond after all the office moves though. There's surely a photo floating around twitter somewhere, but I don't know how to find it.

Best I could find was these diagrams, which are admittedly from 2019, before the code was even OSS:

imageimageimage


couple others from a "scratch diagrams.pptx" I have:
image

image

@zadjii-msft commented on GitHub (May 22, 2023): > Do you also use this for pure C# projects? I wonder, cause there the file tree UI makes way more sense in Visual Studio than cpp Honestly, I can't say I've written any serious production quality C#. A couple small projects here and there. An early prototype of the Terminal was C#. But noting more than a couple files. That being said, I used basically the same workflow for both C++ and my Python side projects. That way I don't really have to worry about how the project is laid out on the filesystem - as long as I know where I'm going, then it's easy enough to just pop open the file by name. > how do you keep a model in your mind of how the entire codebase is connected ![image](https://github.com/microsoft/terminal/assets/18356694/00301b2f-b8a8-44c0-addd-12cde8054a2e) But seriously though - I've been working through re-writes of the Console codebase for 8 years now. I helped design the architecture of the Terminal codebase itself. That's been my 9-5 for years, at this point, it's just instinct. > Does the Windows Terminal Open Source Project have like a map or something No, but it really should. We used to have a giant wall in the office with every library we owned, the paths to the files, and how they all connected. Not sure if that survived in Redmond after all the office moves though. There's surely a photo floating around twitter somewhere, but I don't know how to find it. Best I could find was these diagrams, which are admittedly from 2019, before the code was even OSS: ![image](https://github.com/microsoft/terminal/assets/18356694/14ba7e60-e22b-444d-815c-2b3d09a454fb)![image](https://github.com/microsoft/terminal/assets/18356694/4e5b710c-bce7-4789-81b6-4dd8a0f8aec6)![image](https://github.com/microsoft/terminal/assets/18356694/25dedbcc-927c-4b47-9603-303bf1b11405) <hr> couple others from a "scratch diagrams.pptx" I have: ![image](https://github.com/microsoft/terminal/assets/18356694/e4486347-c65d-4b63-a1e5-48d52bf4e6bc) ![image](https://github.com/microsoft/terminal/assets/18356694/510a4837-e272-4773-8a2a-a3de8698fd67) ![](https://github.com/microsoft/terminal/assets/18356694/1b11b948-84d0-401c-8785-8a4ca177f758)
Author
Owner

@Jaswir commented on GitHub (May 22, 2023):

@zadjii-msft

Maybe you should put this somewhere in the general docs for this project. It would probably also be valuable to others.

So the commandline clients are connected to the windows terminal via a ConPTY Process which is Conhost.exe do I understand that correctly?

@Jaswir commented on GitHub (May 22, 2023): @zadjii-msft Maybe you should put this somewhere in the general docs for this project. It would probably also be valuable to others. So the commandline clients are connected to the windows terminal via a ConPTY Process which is Conhost.exe do I understand that correctly?
Author
Owner

@zadjii-msft commented on GitHub (May 22, 2023):

you should put this somewhere in the general docs for this project

Yep, that needs to be probably significantly updated. Probably will soon, likely as a part of #15065 & #6999.

commandline clients are connected to the windows terminal via a ConPTY Process which is Conhost.exe do I understand that correctly

Yep! That lets conpty emulate the Win32 Console API, while the Terminal only really needs to "speak" in ANSI escape "VT" sequences, which is more like every other terminal that exists.

@zadjii-msft commented on GitHub (May 22, 2023): > you should put this somewhere in the general docs for this project Yep, that needs to be probably significantly updated. Probably will soon, likely as a part of #15065 & #6999. > commandline clients are connected to the windows terminal via a ConPTY Process which is Conhost.exe do I understand that correctly Yep! That lets conpty emulate the Win32 Console API, while the Terminal only really needs to "speak" in ANSI escape "VT" sequences, which is more like _every other terminal that exists_.
Author
Owner

@Jaswir commented on GitHub (May 26, 2023):

@zadjii-msft

Awesome. What is the protocol for this Open Source Project in terms of releasing the fixes?
Are there specific times things are released to the Preview?
Also when do things get added to the Official Windows Terminal that's installed by default on Windows 11. It would be really cool to see a feature that I helped contribute with , that would make me proud. And do all of them get added? Or are some not? , Like a selection of things or something like that?

@Jaswir commented on GitHub (May 26, 2023): @zadjii-msft Awesome. What is the protocol for this Open Source Project in terms of releasing the fixes? Are there specific times things are released to the Preview? Also when do things get added to the Official Windows Terminal that's installed by default on Windows 11. It would be really cool to see a feature that I helped contribute with , that would make me proud. And do all of them get added? Or are some not? , Like a selection of things or something like that?
Author
Owner

@zadjii-msft commented on GitHub (May 29, 2023):

What is the protocol for this Open Source Project in terms of releasing the fixes?
Are there specific times things are released to the Preview?

We usually release new Preview builds like, once every 3-6 months. Exact timing is usually pretty fungible, based on how the actual release cycle is going, or if there are major events (see: Build). I don't think we've really started discussion of when 1.19 will be yet.

when do things get added to the Official Windows Terminal

That's uh.... c o m p l i c a t e d. Technically, the version of the Terminal that actually ships with Windows 11 is like, Terminal 1.12. Yea. That old. There's internal rEaSoNs why that is, but essentially, people should immediately get the newest version of Terminal Stable (as of last week, 1.17), as soon as they log in and the Store gets them an update.

So basically, whenever Terminal 1.20 Preview comes out, 1.19 will get moved to the Stable channel, which is when this feature will be "pre-installed" on Windows 11.

@zadjii-msft commented on GitHub (May 29, 2023): > What is the protocol for this Open Source Project in terms of releasing the fixes? > Are there specific times things are released to the Preview? We usually release new Preview builds like, once every 3-6 months. Exact timing is usually pretty fungible, based on how the actual release cycle is going, or if there are major events (see: Build). I don't think we've really started discussion of when 1.19 will be yet. > when do things get added to the Official Windows Terminal That's uh.... _c o m p l i c a t e d_. Technically, the version of the Terminal that actually ships with Windows 11 is like, Terminal 1.12. Yea. That old. There's internal rEaSoNs why that is, but essentially, people should immediately get the newest version of Terminal Stable (as of last week, 1.17), as soon as they log in and the Store gets them an update. So basically, whenever Terminal 1.20 Preview comes out, 1.19 will get moved to the Stable channel, which is when this feature will be "pre-installed" on Windows 11.
Author
Owner

@DHowett commented on GitHub (May 29, 2023):

That's uh.... c o m p l i c a t e d.

I just checked version 1.17.11461.0 into Windows for the insider program participants! 😉

@DHowett commented on GitHub (May 29, 2023): > That's uh.... c o m p l i c a t e d. I just checked version 1.17.11461.0 into Windows for the insider program participants! 😉
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#19655