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

"theme" command setting seems to ignore window dimensions #251

Open
ChrisMoriarty opened this issue Feb 19, 2019 · 11 comments
Open

"theme" command setting seems to ignore window dimensions #251

ChrisMoriarty opened this issue Feb 19, 2019 · 11 comments

Comments

@ChrisMoriarty
Copy link

What I choose as my default theme in the Terminal preferences seems to drive the dimensions of the window, even if I specify other themes in the json file.

When I specify a theme parameter (eg "theme": "Ocean"), the colors work, but shuttle seems to ignore the specific window dimensions. Instead it uses the dimensions from the default theme.

I am using Terminal.app as my terminal, and I'd like to apply a custom theme to a few of my commands. One of which requires a longer terminal window. A workaround is to make the default terminal theme have a longer window. But now all my terminal windows are long.

@thshdw
Copy link
Collaborator

thshdw commented Feb 19, 2019

Hi @ChrisMoriarty any difference if this is a new tab or a new window?

@thshdw
Copy link
Collaborator

thshdw commented Feb 19, 2019

              "cmd": "ssh [email protected]",
              "inTerminal": "tab",
              "name": "SSH blog - Opens in Tab of active window",
              "theme": "Ocean",
              "title": "title of tab"

or

              "cmd": "ssh [email protected]",
              "inTerminal": "new",
              "name": "SSH blog - Opens in new window",
              "theme": "Ocean",
              "title": "title of window"

does it work with tab or new?

@ChrisMoriarty
Copy link
Author

Tab is sort of irrelevant here, isn't it? The use case is for "new" window, with it's own dimensions. For science, I added the tab sample you pasted and tried it both with an existing window, and with no terminal open. Both open with the default dimensions, not the dimensions specified in the Ocean theme.

@thshdw
Copy link
Collaborator

thshdw commented Feb 19, 2019

Thanks for testing. I'll look into this.

Are the colors you have in the Ocean theme getting applied?

@ChrisMoriarty
Copy link
Author

Np. Yes, the colors got applied both for "tab" and "new".

@thshdw
Copy link
Collaborator

thshdw commented Feb 20, 2019

It seems that applescript is ignoring the size because it has its own sizing capability with the bounds property. Maybe this is better anyway because you could then set the x and y positions.

set bounds of front window to {800, 96, 80, 500}

screen shot 2019-02-19 at 10 38 08 pm

@ChrisMoriarty
Copy link
Author

I'm not sure I follow. Are you saying I can specify "bounds" as a command setting?

@thshdw
Copy link
Collaborator

thshdw commented Feb 20, 2019

I will need to add a size declaration the the command settings. Something like:

"size": "VALUE"

Then we can pass this value to the applescript

@thshdw
Copy link
Collaborator

thshdw commented Feb 20, 2019

I need to do some testing to see if this is occurring with iTerm themes

@thshdw
Copy link
Collaborator

thshdw commented Feb 21, 2019

I need to do some testing to see if this is occurring with iTerm themes

iTerm is correctly setting the window size in the profile/theme.

I'll make another set of applescripts specifically for window positioning. This way users won't be forced to set a size on every command. If you don't want to set a position and size for your terminal window then nothing will change. If you specify a position and size then shuttle will use specific positioning applescripts.

This will only work with commands run in new windows. If you have the size setting in your command options I'll force a new window.

@ChrisMoriarty
Copy link
Author

That's good to know that iTerm works. I thought about giving it a try at some point. Your solution sounds good to me. Good luck, and thanks for taking the time to fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants