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

test fix for iTerm quiet opening config #64

Merged
merged 4 commits into from Sep 2, 2022

Conversation

luckman212
Copy link
Contributor

@vitorgalvao
Copy link
Owner

Thank you for submitting the fix! Question: which method are you using to start with no windows? Perhaps we can do something automatically (reading preferences) to auto-determine when that’s enabled and act accordingly (i.e. without the user having to change a specific setting in the script’s config).

@luckman212
Copy link
Contributor Author

Thanks. I can't remember if or where in the GUI this is configured, but I looked at the prefs plist and it appears to be one or all of

$ defaults read com.googlecode.iterm2 | grep -i startup

    OpenArrangementAtStartup = 0;
    OpenNewWindowAtStartup = 0;
    OpenNoWindowsAtStartup = 1;

@luckman212
Copy link
Contributor Author

I pushed another small change that adds a timeout so at least the script doesn't loop forever.

@luckman212
Copy link
Contributor Author

image

@luckman212
Copy link
Contributor Author

Not sure if parsing the prefs plist every time is worth the extra overhead of just documenting & setting the property. I seem to be one of the only people affected by this anyway, hate to slow down everyone else's workflows just to implement that. @vitorgalvao

@luckman212
Copy link
Contributor Author

I experimented and found that these are the relevant pref keys:

to turn ON "quiet" open mode (no windows open when launched from Dock):

defaults write com.googlecode.iterm2 OpenNewWindowAtStartup -bool FALSE
defaults write com.googlecode.iterm2 OpenNoWindowsAtStartup -bool TRUE

to turn OFF quiet mode:

defaults write com.googlecode.iterm2 OpenNewWindowAtStartup -bool TRUE
defaults write com.googlecode.iterm2 OpenNoWindowsAtStartup -bool FALSE

@luckman212
Copy link
Contributor Author

luckman212 commented Sep 2, 2022

I saw your note about "with timeout" does not work with a "repeat" but I am not using with timeout I am using repeat until... which definitely works, I tested it.

Nevermind, I see what you did there. Thanks 👍

@vitorgalvao
Copy link
Owner

Not sure if parsing the prefs plist every time is worth the extra overhead of just documenting & setting the property.

Agreed. If there were a simple way to read the preferences from AppleScript (like the defaults command) it should be worth it as those are cached by macOS. But there seems to be no such way (do shell script and parsing the response isn’t great either).

Nevermind, I see what you did there.

Yep, the comment is so someone arriving later knows that was tried. If it worked, it would have been the cleanest way.

Looks like this is good to go! I’ll merge and make a new release. Thank you again. Have a nice weekend!

@vitorgalvao vitorgalvao merged commit 47969b6 into vitorgalvao:master Sep 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants