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

Quake mode: Add support for reserved tabs #10279

Open
Tracked by #8888
deoradh opened this issue May 30, 2021 · 19 comments
Open
Tracked by #8888

Quake mode: Add support for reserved tabs #10279

deoradh opened this issue May 30, 2021 · 19 comments
Labels
Area-Settings Issues related to settings and customizability, for console or terminal Area-Windowing Window frame, quake mode, tearout Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal.
Milestone

Comments

@deoradh
Copy link

deoradh commented May 30, 2021

Description of the new feature/enhancement

The current quake mode implementation entails a window with a well-known name. This window gets specially handled with regard to summoning: it gets docked and focus mode is turned on. It is otherwise a normal window capable of hosting multiple tabs.

There are existing requests filed for supporting multiple quake mode windows, each with a different profile running. That seems unnecessary given the ability for an existing terminal window to host multiple profiles already. What is lacking is the ability to specify which tab to bring active on summon.

Proposed technical implementation details (optional)

Allow the ability to define reserved tabs by name:

"windows": [
  {
    "name": "_quake",
    "tabs": [
      { "profile": "<guid or name .. not sure which would be better>", "name": "my PS tab" },
      { "profile": "...", "name": "my scratchpad tab" },
      { "profile": "...", "name": "my wolfram tab 1" },
      { "profile": "...", "name": "my wolfram tab 2" },
      { "profile": "...", "name": "org mode" },
      { "profile": "...", "name": "dashboard" }
    ]
  }
]

or, alternatively, add "window" and "tab" names to the existing profile schema, binding them exclusively:

{
    "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
    "hidden": true,
    "name": "PowerShell",
    "window": "_quake",
    "tab": "my PS tab"
}

Then add an argument to wt.exe that allows specification of the specific tab name to activate (or, if the alternative approach is taken, a profile which has a window and tab name defined). If it is not already live, it will be activated. In this way, hot keys can be defined to summon specific tabs.

On exit or close of any of the named tabs, the tab will remain open, waiting to restart the command in question (immediately, if currently active).

Additional tabs created in the window will follow after the named tabs.

@deoradh deoradh added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label May 30, 2021
@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 May 30, 2021
@deoradh
Copy link
Author

deoradh commented May 30, 2021

Potentially related to #766, #9992

@dag03tsc
Copy link

LGTM.

The first option with guid names seems more flexible but I would replace the tabs object with an startupActions string to enable further launch customization, and maybe add a few more properties.

"windows": [
   {
     "name": "_quake",
     "startupActions": "",
     "alwaysOnTop": true,
   }
 ]

Sadly, that'd made this a duplicate of #9992, and this should be closed 'cause #9992 seems to be a more uniform and flexible approach.

@deoradh
Copy link
Author

deoradh commented May 31, 2021 via email

@dag03tsc
Copy link

dag03tsc commented May 31, 2021

Ok, now I see what you mean.

Maybe there should be an additional tab string property inside the window object but what happens when there're two tabs, each one with an instance of the same profile, and both inside the same window?

It'd require some kind of "discrimination keybinding" and/or "tab switcher" applied N times over the exact same profile. Some kind of circular keybinding like the tab switcher's ctrl+tab but with a custom sequence and applied to tabs that share the same profile or something like that but I'm not really sure of its usefulness.

@deoradh
Copy link
Author

deoradh commented May 31, 2021 via email

@dag03tsc
Copy link

... but what happens when there're two instances of the same tab in the same window?

I apologize. I've committed a mistake. I meant two tabs, each one with an instance of the same profile, and both inside the same window.

I'm not really sure I got it right. Do you mean something like the ctrl+alt+f* of some Linux distros? Some predefined launch keybindings targeting some predefined set of windows?

@deoradh
Copy link
Author

deoradh commented May 31, 2021 via email

@dag03tsc
Copy link

dag03tsc commented Jun 1, 2021

Uniqueness of identifiers is a general presumption about identifiers

Strictly speaking, that's not true.
It's true that some UUIDs may seem unique but it's all about deterministic algorithms with seeds.
I'm not really sure about Microsoft GUIDs but for UUIDs, seeds can be categorized as:

  • Date & MAC based: v1 and v2.
  • Pseudo-Random based: v4.
  • Namespace based: v3 and v5.

You'll clearly see that each one is strictly deterministic, even the Pseudo-Random one, therefore the uniqueness holds if, and only if the seed, or set of seeds, is unique itself; the UUID uniqueness is directly inherited from its seeds uniqueness.

Uniqueness of identifiers means those tabs would be distinguishable.

How'd you prevent collisions while, at the same time, enable a way to know a tab's GUID prior the actual tab's creation?
You'd need to know it before its creation to be able to use it as a CLI parameter, property setting or keybinding.

It would be a syntactic error in the profile to permit collisions.

I'm pretty sure we all agree that a profile is just a pattern of initialization for any tab's pane, therefore it cannot be linked to a single tab or pane. While a pane must always reference one, and only one profile, a profile can be referenced from N panes without restriction; it just make no sense talking about tab collisions within a profile context, 'cause profiles apply to panes, not tabs.

@deoradh
Copy link
Author

deoradh commented Jun 1, 2021 via email

@deoradh
Copy link
Author

deoradh commented Jun 1, 2021 via email

@dag03tsc
Copy link

dag03tsc commented Jun 1, 2021

I read your suggestion and I fully understood it, but I'm not sure I've explained myself right.
Please, don´t get me wrong, I just try to be constructive and to debate, not to argue, so I apologize if I offended you somehow.

What you call tab, is actually a collection of panes, and the name of a pane is, in fact, the name of the profile loaded inside it, as well as many other inherited properties like background, tab color, GUID, etc.
When you click over (or focus) a pane, the tab just reflects the properties of the focused pane.

Due to its focus inheritance nature, conceptually, I guess there's no such thing like a tab ID, despite its position, 'cause it's just a simple group of panes created for the sole purpose of easing the navigation, and the properties of each of these pseudo-groups called tabs relays entirely on its currently focused pane.

I see that you'd like to have some kind of unique ID for each tab. You called it name and I called it GUID; let's call it UID (Unique ID).
Maybe a few more properties too. Even a completely new entity definition inside the model like #9992 proposes, but for tabs.
But that's the main reason I called this /dup #9992 , 'cause @zadjii-msft asked the community for possible additional properties and this could be one of them.

If you reformulate this suggestion, it mainly asks for adding the next properties inside the window entity that #9992 proposes:

"tabs": {
  "name": string;
  "index": number;
  "panes": {
    "index": number;
    "profile": string;
    "size": number;
    "split": string;
    "splitMode": string;
  }[];
}[];
"defaultTab": string;

As you see, I added a few more interesting properties and enabled managing multiple panes too, but it does not make this a new issue. I'd still consider it as a comment for enhancement to #9992. In fact, that's exactly what I'm going to do right now.

@deoradh
Copy link
Author

deoradh commented Jun 1, 2021 via email

@dag03tsc
Copy link

dag03tsc commented Jun 1, 2021

I'm so sorry but you clearly misunderstood my intentions 'cause I've never meant to hijack anything from anyone.
My only intention is to collaborate with the community in bringing new features aboard and fixing bugs.

In addition, I always give the credit to whom it belongs, as you can see in the first line of the last comment I've written in 9992.
Obviously, I've linked this suggestion to give it visibility and raise it, not to pull it down or to hijack it in any way, and I'm really sorry if I offended you in any way with that misunderstanding.

I really look for this feature to become available so everyone can benefit from it! 😊 👍

@zadjii-msft
Copy link
Member

Okay so this issue sounds to me like two separate requests:

Focusing on just the first half of the request (as discussion on the second is probably best saved for #5969) - I'm not sure there's a simple way to express that. Given the possible scenarios that a user might want for that, IMO, the mentally easiest model is to just press two keybindings. win+`, ctrl+alt+2 is a little bit of keyboard gymnistics, but you could always rebind actions so that it's easier. If you want to get weird, you could bind:

{ "keys": "win+alt+1", "command": { "action": "globalSummon" } },
{ "keys": "win+alt+2", "command": { "action": "globalSummon" } },
{ "keys": "win+alt+3", "command": { "action": "globalSummon" } },
{ "keys": "win+alt+4", "command": { "action": "globalSummon" } },
//...

(to bind all of win+alt+N to "summon the window"),

Then, do something like win+alt+2, ctrl+alt+2 to not have to move that many fingers.

@zadjii-msft zadjii-msft added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Jul 6, 2021
@ghost ghost added the No-Recent-Activity This issue/PR is going stale and may be auto-closed without further activity. label Jul 11, 2021
@ghost
Copy link

ghost commented Jul 11, 2021

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@deoradh
Copy link
Author

deoradh commented Jul 11, 2021

{ "keys": "win+alt+1", "command": { "action": "globalSummon" } },
{ "keys": "win+alt+2", "command": { "action": "globalSummon" } },
{ "keys": "win+alt+3", "command": { "action": "globalSummon" } },
{ "keys": "win+alt+4", "command": { "action": "globalSummon" } },
//...

That looks like a reasonable compromise.

@ghost ghost added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something No-Recent-Activity This issue/PR is going stale and may be auto-closed without further activity. labels Jul 11, 2021
@zadjii-msft
Copy link
Member

Awesome, thanks for following up!

@deoradh
Copy link
Author

deoradh commented Jul 12, 2021 via email

@zadjii-msft
Copy link
Member

zadjii-msft commented Jan 11, 2022

Sorry, this got lost in my mailbox and I'm just thinking of it again. I'm resurrecting this, because it tracks well with another thread I'm about to file.

Proposal:

  • tabIndex: Switch to that tab, if there are that many.

@zadjii-msft zadjii-msft reopened this Jan 11, 2022
@zadjii-msft zadjii-msft added Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal. and removed Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Needs-Attention The core contributors need to come back around and look at this ASAP. labels Jan 11, 2022
@zadjii-msft zadjii-msft added this to the Backlog milestone Jan 11, 2022
@zadjii-msft zadjii-msft added Area-Settings Issues related to settings and customizability, for console or terminal Area-Windowing Window frame, quake mode, tearout labels Jan 11, 2022
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Jan 11, 2022
@zadjii-msft zadjii-msft removed the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Feb 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Settings Issues related to settings and customizability, for console or terminal Area-Windowing Window frame, quake mode, tearout Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal.
Projects
None yet
Development

No branches or pull requests

3 participants