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

Add per-window-name global settings #9992

Open
zadjii-msft opened this issue Apr 29, 2021 · 24 comments
Open

Add per-window-name global settings #9992

zadjii-msft opened this issue Apr 29, 2021 · 24 comments
Labels
Area-Settings Issues related to settings and customizability, for console or terminal Area-Windowing Window frame, quake mode, tearout Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Product-Terminal The new Windows Terminal.
Milestone

Comments

@zadjii-msft
Copy link
Member

zadjii-msft commented Apr 29, 2021

This one's from a team sync chat thread.

What if there was a way to say

"windows": {
  "work": {
    "alwaysOnTop" : true,
    "initialPosition": "2000, 50",
    "centerOnLaunch": true,
    "launchMode": "focus",
    "startupActions": "sp ; sp ; nt -p Ubuntu"
  },
  "_quake": {
    "launchMode": "default",
    "startupActions": "nt -p PowerShell"
  }
}

So that you could have different sets of global settings for different window names? What properties would make sense here? Definitely not windowingBehavior, because that's a global setting, not a window setting.

@zadjii-msft zadjii-msft added the ⛺ Reserved For future use label Apr 29, 2021
@DHowett
Copy link
Member

DHowett commented Apr 29, 2021

  1. This would make it so much easier for people to have "work profiles" they come into in the morning
  2. Specialization for quake that isn't special
  3. GlobalAppSettings is already inheritable (!)

Bad points:

  1. what if you rename a window

@zadjii-msft zadjii-msft added Area-Settings Issues related to settings and customizability, for console or terminal Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Product-Terminal The new Windows Terminal. and removed ⛺ Reserved For future use labels Apr 30, 2021
@zadjii-msft zadjii-msft added this to the Terminal Backlog milestone Apr 30, 2021
@dag03tsc
Copy link

dag03tsc commented May 31, 2021

I agree this could be pretty useful indeed. Meanwhile, if anyone needs it, I've managed to alter the behavior of the _quake window with this setting:

"startupActions": "wt -w _quake sp -H -p CMD -s .666 \\; sp -H -p UBUNTU -s .5"

The above is just an example of a "quaked" 3-pane symmetric vertical arrange. It's a "hackity-hack" bypass, 'cause I'm just using a legit functionality for something it wasn't designed to, but I'll try to explain its two key points.

First point, if wt -w _quake is the first subcommand provided, it replaces the initially launched window with a "Quake Mode" enabled one; otherwise, it opens an independent one.

Second point, there's a huge difference between writing semicolons ; or escaped semicolons \\;, and the arranging of commands is very important; all subcommands before wt -w _quake are applied within the initially launched window and must be preceded by unescaped semicolons ;, while all subcommands after wt -w _quake are applied within the new "quaked" window and must be preceded by escaped semicolons \\; in order to bypass the initially launched window parsing.

As an example, let's say you want to launch two separate windows with a 2-pane horizontal arrange (PWSH and CMD): a "quaked" one and a "standard" one. If your default profile is PWSH, then you'd write the next setting:

"startupActions": "sp -V -p CMD -s .5 ; wt -w _quake \\; sp -V -p CMD -s .5"

I hope someone finds it useful.

BTW, congratulations! WT is awesome and I really like where it is heading by becoming the Isildur's Bane of all terminals! 🥇

@dag03tsc
Copy link

dag03tsc commented Jun 1, 2021

@zadjii-msft, I list some additional properties from #10279 that could be useful inside each window entity, along with a short explanation.

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

The goal of tabs is to allow the auto-initialization of multiple tabs and panes and parameterize its behavior.

The property name should be any kind of unique identifier for the tab.
It'd mainly be used by the defaultTab property pairing process but it could also be used with a switchToTab action keybinding.

The property index must decide the order of creation, both for tabs and panes.

The goal of defaultTab is to allow the customization of the initially selected tab.
In other words, once all tabs have been initialized, automatically switch to the tab with name equal to defaultTab.
If defaultTab is undefined, fallback to the last or first one.

I think that profile, size, split and splitMode properties details are quite self-explanatory from the Panes doc but I'll be glad to add its details too if needed.

@jhhcs
Copy link

jhhcs commented Jul 22, 2021

Hey everyone, I found this thread while intending to open a feature request for the Quake mode window, which I will just leave here as a user story.

I am using the FAR manager inside Windows terminal and as a FAR user, I would like to be able to configure the Quake mode window so that it covers the entire screen. I currently have ConEmu setup in this exact way; it allows me to switch between using FAR and other windowed applications very quickly and efficiently.

@zadjii-msft
Copy link
Member Author

@jhhcs FYI you don't need to use the quakeMode action to summon the window - you could always just configure the Terminal to launch in fullscreen mode, and rebind win+` to a plain old globalSummon action.

@jhhcs
Copy link

jhhcs commented Jul 23, 2021

Oh thank you for that hint, yes that works quite nicely. I then discovered that toggling fullscreen with Alt+Enter can also be used to switch the Quake window to full screen as an alternative solution to my problem.

@rnett
Copy link

rnett commented Sep 25, 2021

User story:
I'd like to be able to have one quake window for WSL ZSH, and another for Powershell. This currently does not seem to be possible.

@zadjii-msft
Copy link
Member Author

@rnett For now, you could always just give the two windows different names, and bind two separate globalSummon actions for those different names. You'd be able to get the dropdown on each now, but not necessarily the "snap to the top half" behavior.

@si-kotic
Copy link

si-kotic commented Jan 22, 2022

With regards to tabs in Quake mode, that's what brought me here. Unlike the OP of #11085 I would prefer them on the bottom of the window to the top. Making this configurable would make sense to me, as would being able to toggle them on and off both as a default setting and also during a session.

EDIT: I just accidentally discovered that, if I hold Ctrl while tabbing, I get a vertical list of open tabs. This mostly solves my issue, good work. Is there a similar way of seeing the list of profiles when you're launching a new one?

EDIT AGAIN: I've answered my own question; Ctrl+Shift+Space brings up the profiles list.

@zadjii-msft
Copy link
Member Author

@si-kotic you may also be interested in following #835

@xorinzor
Copy link

Any updates on this? Having to toggle focus mode manually every time Quake mode starts is quite annoying.
Feels like this issue is trying to bundle too many separate issues into 1 fix.

Sure, profiles would be nice, but that's more of a "feature" then a bugfix.

@markusdd
Copy link

markusdd commented Feb 1, 2023

yes I am confused why I got redirected here.
This is a super simple request: launch a quake window with focus mode disabled. can't be done apparently, or does anyone have a solution?

I am not intesred in any of the other things being discussed, but the original ticket redirects here.

There is a -f switch to toggle focus mode on, why isn't there one to keep it off?

@zadjii-msft
Copy link
Member Author

Alright, I'm calling it for this hackathon, but progress notes from the week:

Latest branch was: dev/migrie/fhl-fall-2023/11162-quake-III-arena

Sample JSON

{
    "name": "_quake",
    "defaultProfile": "haunter.gif",
    "dockWindow": {
        "side": "bottom",
        "width": 0.3,
        "height": 0.75
    },
    "centerOnLaunch": true,
    "initialPosition": "",
}
  • Moving the window settings into their own object is tedious, but easy. Almost everything becomes a per-window setting.
  • Layering window settings is annoying. They'll work like
    graph LR
    
    uq[user: _quake]
    uf[user: foo]
    ub[user: base]
    dq([defaults: _quake])
    db[defaults: base]
    
    uf  --> ub --> db
    uq --> dq --> ub
    
    • We make a "virtual" window settings blob if the user asks for a quake window.
    • If the user does specify settings for the _quake window, then it'll still be applied on top of the "builtin" quake settings
  • If you don't use this at all, I don't think your settings will change at all1
  • I don't have hot-reloading working
  • I don't have hot-renaming working
  • I don't have startupActions working
  • There are some other TODO!s I've left scattered.
  • I've added a new settings blob to per-window settings: dockWindow. These are for Adjust styling of quake window (default height, etc) #11162 and Quake Mode - Allow Horizontal resizing #11174
    • side: which side to "dock" to
    • width & height: How big to make the window.
      • If >1, that value is treated as px
      • If <=1.0, that value is treated as a percent of the screen
    • It also combines with centerOnLaunch, to center the window on that side
    • It should warn if you set a value to <=0
    • It should maybe obey initialPosition if centerOnLaunch isn't set
    • It doesn't "dropdown" from the docked side
    • It's a few pixels off from the right position. I think the ncSize.height is bigger than I'm expecting.
  • This altogether does nothing for Quake Mode should remember its size #12594. It probably should!

Footnotes

  1. an empty "windows":[] may be added.

@drannex42
Copy link

Quick tip for everyone, you can set it to open in quake mode, and then set a keyboard shortcut to disable focus mode. I personally use win+ctrl+f for this. The tabs will remain in view for the entirety of the process lifetime.

@Squidyy
Copy link

Squidyy commented Mar 3, 2024

Quick tip for everyone, you can set it to open in quake mode, and then set a keyboard shortcut to disable focus mode. I personally use win+ctrl+f for this. The tabs will remain in view for the entirety of the process lifetime.

Thank you this is very helpful

@shookietea
Copy link

Leaving my question here because it's related- I'm wanting quake mode functionality with a maximized window.

I've got a globalSummon action setup for a separate named _default window, with focus and maximized arguments. This mostly works (without the quake animation).

Is there a way to hide the taskbar icon when I've got this minimized, like the special _quake window does?

{
  "command": {
    "action": "globalSummon",
    "desktop": "toCurrent",
    "MaximizeAfterToggle": true,
    "dropdownDuration": 0,
    "monitor": "toMouse",
    "name": "_default",
    "toggleVisibility": true
  },
  "keys": "win+`"
  }

"startupActions": "wt --window _default -f -M \\; sp -V -s .666",

@zadjii-msft
Copy link
Member Author

It's not really a "basic feature". It requires a pretty massive re-write of how our settings are stored. You can take a look at the all-up diff in main...dev/migrie/fhl-fall-2023/11162-quake-III-arena. There are piecemeal diffs listed in the OP as well. If you're passionate, you're more than free to take that over the finish line.

You're also free to just use "globalSummon" instead of "quakeMode". IMO that's got quite a bit more flexibility. I honestly love focus mode, but don't care at all for the dropdown, so I just use globalSummon.

@shookietea
Copy link

You're also free to just use "globalSummon" instead of "quakeMode". IMO that's got quite a bit more flexibility. I honestly love focus mode, but don't care at all for the dropdown, so I just use globalSummon.

Is it currently possible to have "globalSummon" hide the taskbar icon when it is not visible?

@zadjii-msft
Copy link
Member Author

With these two settings, I'm pretty sure it is:

@shookietea
Copy link

Perfect! The animation is the lowest on my list, and wt is set up as I want now. Appreciate your support

@Vampire
Copy link

Vampire commented Apr 1, 2024

If you want the animation, just enable it.
"action": "quakeMode" is just a "action": "globalSummon" with all parameters default except for "dropdownDuration": 200,
and that the terminal treats it different like auto-enabling Fokusmode.

Thanks to this issue, I have the exact behavior I want now, because I always hated that in quakemode fokusmode was auto-enabled and size was not retained.
Not that I learned about globalSummon I have exactly what I want where before I had to live with non-retained size and that on each terminal reatart I had to manually disable focusmode.

So just set "dropdownDuration": 200 for your command and you also have the animation back.

@markusdd
Copy link

markusdd commented Apr 3, 2024

That really begs the question if quake mode should be dropped for the sake of that settings combination (meaning the setting is actually retained but that is what it does internally.)

So that I do not have to piuece this together myself, does anyone have a complete config snippet that emulates quake mode fully through global summon without focus mode

@shookietea
Copy link

Unfortunately, adding "dropdownDuration": 200 doesn't work. When added to my command below, it causes the window size to be inconsistent after the first opening. It does add the animation, but breaks the behavior I want, which is full screen.

    {
      "command": {
        "action": "globalSummon",
        "desktop": "toCurrent",
        "MaximizeAfterToggle": true,
        "monitor": "toMouse",
        "name": "_default",
        "toggleVisibility": true
      },
      "keys": "win+`"
    }

@Vampire
Copy link

Vampire commented Apr 4, 2024

@markusdd maybe you should learn to read ;-)
As I already said, just "action": "globalSummon" with all parameters default except for "dropdownDuration": 200 is doing that, even the documentation of quakeMode tells you the globalSummon equivalent.

And regarding

without stupid focus mode (that no one ever asked for, it's useless)

Just because you hate it and I don't like it, does not mean that no-one asked for it or that it is useless.
Even in this issue there is proof of love for the focus mode and without it, it is not anymore that quake-like that it is now.

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-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Product-Terminal The new Windows Terminal.
Projects
None yet
Development

No branches or pull requests

13 participants