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

Open panes with a specific profile #998

Closed
zadjii-msft opened this issue May 24, 2019 · 1 comment · Fixed by #3825
Closed

Open panes with a specific profile #998

zadjii-msft opened this issue May 24, 2019 · 1 comment · Fixed by #3825

Comments

@zadjii-msft
Copy link
Member

@zadjii-msft zadjii-msft commented May 24, 2019

You can only open a pane with the default profile

I left space for adding support for opening a specific pane, but it didn't really seem like there was a good keychord for doing this currently. Maybe if we added support for multi-key keychords, then it'd make more sense.

EDIT:

With #3391 merged, this is pretty possible now.

I'd really like for this to work like the following:

    { "command": "splitHorizontal", "keys": [ "alt+shift+-" ] },
    { "command": "splitVertical", "keys": [ "alt+shift+plus" ] },

    { "keys": [ "alt+1" ], "command": { "action": "split", "style": "horizontal" } },
    { "keys": [ "alt+2" ], "command": { "action": "split", "style": "vertical", "profile": "{some-guid}" } },
    { "keys": [ "alt+3" ], "command": { "action": "split", "style": "horizontal", "type": "duplicate" } },
    { "keys": [ "alt+4" ], "command": { "action": "split", "style": "vertical", "type": "prompt" } },

The first two entries are the legacy style keybindings for panes.

The next four represent 4 different ways of opening a new pane:

  • alt+1: Open a new pane with the default profile. This is the current behavior.
  • alt+2: Open a new pane with the profile with guid "{some-guid}". (this issue)
  • alt+3: Open a new pane with the same profile as the currently focused pane. (this is tacked in #1756)
  • alt+4: Open a new pane by prompting the user first. (this is tacked in #3586)

This issue will track just that second option.

@invy

This comment has been minimized.

Copy link

@invy invy commented Sep 30, 2019

There are few options (inspired by i3)

  1. Popup Dialog:
    Specifig key combinatin will trigger a popup dialog with all profiles, where user can select specific profile.
  2. Ability to rearrange tabs with key combinations (inclusive ability to transform tab into a tile in specific window)
  3. i3 way: enable specifyc tiling mode (vertical/horizontal), then DMenu like: just search for specific profile (or even a specific command, which can be executed in specific profile)...
zadjii-msft added a commit that referenced this issue Nov 28, 2019
## Summary of the Pull Request

We already have "splitHorizontal" and "splitVertical", but those will both be deprecated in favor of "splitPane" with arguments. 

Currently, there's one argument: "style", which is one of "vertical" or "horizontal."

## References
This is being done in pursuit of supporting #607 and #998. I don't really want to lob #998 in with this one, since both that and this are hefty enough PRs even as they are. (I have a branch for #998, but it needs this first)

This will probably conflict with #3658
## PR Checklist
* [ ] Doesn't actually close anything, only enables #998
* [x] I work here
* [ ] Tests added/passed - yea okay no excuses here
* [x] Requires documentation to be updated

## Validation Steps Performed
Added new keybindings with the args - works
Tried the old keybindings without the args - still works
---------------------------------------
* Add a 'splitPane' keybinding that can be used for splitting a pane either vertically or horizontally

* Update documentation too

* Good lord this is important

* Add a test too, though I have no idea if it works

* "style" -> "split"

* pr comments from carlos
@zadjii-msft zadjii-msft self-assigned this Dec 3, 2019
@msftbot msftbot bot added the In-PR label Dec 3, 2019
@msftbot msftbot bot closed this in #3825 Dec 9, 2019
@msftbot msftbot bot added Resolution-Fix-Committed and removed In-PR labels Dec 9, 2019
msftbot bot added a commit that referenced this issue Dec 9, 2019
…errides (#3825)

## Summary of the Pull Request


This enables the user to set a number of extra settings in the `NewTab` and `SplitPane` `ShortcutAction`s, that enable customizing how a new terminal is created at runtime. The following four properties were added:
* `profile`
* `commandline`
* `tabTitle`
* `startingDirectory`

`profile` can be used with either a GUID or the name of a profile, and the action will launch that profile instead of the default.

`commandline`, `tabTitle`, and `startingDirectory` can all be used to override the profile's values of those settings. This will be more useful for #607.

With this PR, you can make bindings like the following:

```json

{ "keys": ["ctrl+a"], "command": { "action": "splitPane", "split": "vertical" } },
{ "keys": ["ctrl+b"], "command": { "action": "splitPane", "split": "vertical", "profile": "{6239a42c-1111-49a3-80bd-e8fdd045185c}" } },
{ "keys": ["ctrl+c"], "command": { "action": "splitPane", "split": "vertical", "profile": "profile1" } },
{ "keys": ["ctrl+d"], "command": { "action": "splitPane", "split": "vertical", "profile": "profile2" } },
{ "keys": ["ctrl+e"], "command": { "action": "splitPane", "split": "horizontal", "commandline": "foo.exe" } },
{ "keys": ["ctrl+f"], "command": { "action": "splitPane", "split": "horizontal", "profile": "profile1", "commandline": "foo.exe" } },
{ "keys": ["ctrl+g"], "command": { "action": "newTab" } },
{ "keys": ["ctrl+h"], "command": { "action": "newTab", "startingDirectory": "c:\\foo" } },
{ "keys": ["ctrl+i"], "command": { "action": "newTab", "profile": "profile2", "startingDirectory": "c:\\foo" } },
{ "keys": ["ctrl+j"], "command": { "action": "newTab", "tabTitle": "bar" } },
{ "keys": ["ctrl+k"], "command": { "action": "newTab", "profile": "profile2", "tabTitle": "bar" } },
{ "keys": ["ctrl+l"], "command": { "action": "newTab", "profile": "profile1", "tabTitle": "bar", "startingDirectory": "c:\\foo", "commandline":"foo.exe" } }
```

## References

This is a lot of work that was largely started in pursuit of #607. We want people to be able to override these properties straight from the commandline. While they may not make as much sense as keybindings like this, they'll make more sense as commandline arguments.

## PR Checklist
* [x] Closes #998
* [x] I work here
* [x] Tests added/passed
* [x] Requires documentation to be updated

## Validation Steps Performed
There are tests 🎉

Manually added some bindings, they opened the correct profiles in panes/tabs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.