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 If then else in json schema for conditional logic #11600

Closed
Joel-Nickson opened this issue Oct 24, 2021 · 4 comments
Closed

Add If then else in json schema for conditional logic #11600

Joel-Nickson opened this issue Oct 24, 2021 · 4 comments
Labels
Area-Settings Issues related to settings and customizability, for console or terminal Issue-Question For questions or discussion Needs-Attention The core contributors need to come back around and look at this ASAP. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Product-Terminal The new Windows Terminal.

Comments

@Joel-Nickson
Copy link

Joel-Nickson commented Oct 24, 2021

Description of the new feature/enhancement

It would be nice to have conditions in json as defined in json-schema.org

Proposed technical implementation details (optional)

settings.json
...
"if":{"startingDirectory": "C:\\WINDOWS\\system32"},
"then":{"startingDirectory": "%USERPROFILE%\\Desktop"},
"else":{"startingDirectory": "."},
...

Problem:

  • I have set the "startingDirectory": "." in the settings.json for now. In that case the
    wt starts up at "C:\WINDOWS\system32" if i start the terminal from the start Menu or using an Autohot-key or any other app that can create an instance of the wt (like opening from cmd or from sublime-text),
    and if I right click on a folder and open the terminal then I get the terminal in the current directory of the folder.

  • And if I set the "startingDirectory": "C:\Users\\Desktop" then I get the terminal in that directory always(except on opening using menubar in a folder) even if I want to open it on a current folder sometimes

Other use cases:

  • increase the size of the terminal when using the split-pane actions maybe like
"when": {"command": {"action":"splitPane"}},
"then":["initialCols": 180,"initialRows": 30]
  • or changing the background of the window based on the current time(if it was possible to read system time or any how)
@Joel-Nickson Joel-Nickson added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label Oct 24, 2021
@ghost ghost added Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Oct 24, 2021
@Joel-Nickson
Copy link
Author

Sadly, I am not a developer from ms.
This issue will be tracked by the bot and then will be reviewed by the maintainers or developers and they have the power to assign this to you, not me.
If you know know what you need to do then I am sure you can work on it once they approve.

@zadjii-msft
Copy link
Member

@Joel-Nickson Is this not something that the commandline wt -d .would solve? I'd worry about adding a lot of potential complexity here. This sounds like something that'd be neigh-impossible to hook up to the settings UI in a reasonable fashion.

increase the size of the terminal when using the split-pane actions

This sounds like a good use case for the multipleActions action (new in 1.12), combined with the setWindowPos action (which is on my personal backlog but I don't think I filed anywhere)

changing the background of the window based on the current time(if it was possible to read system time or any how)

Now, that one doesn't have a good alternate solution, but feels like a good extension idea (#4000)

@zadjii-msft zadjii-msft added Area-Settings Issues related to settings and customizability, for console or terminal Issue-Question For questions or discussion Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something Product-Terminal The new Windows Terminal. and removed Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. labels Oct 25, 2021
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Oct 25, 2021
@Joel-Nickson
Copy link
Author

multipleActions action (new in 1.12), combined with the setWindowPos action

I can't wait for the wt v1.12 then

Is this not something that the commandline wt -d . would solve?

and yes, that solved my problem 1

@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 labels Oct 25, 2021
@zadjii-msft
Copy link
Member

Glad to hear it! I'm gonna close this for now since the underlying problem is solved. If we come up with more elaborate use cases, and a more well-defined design, we can reopen in the future. Thanks!

@ghost ghost deleted a comment Nov 8, 2021
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 Issue-Question For questions or discussion Needs-Attention The core contributors need to come back around and look at this ASAP. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Product-Terminal The new Windows Terminal.
Projects
None yet
Development

No branches or pull requests

2 participants