lra / mackup

Keep your application settings in sync (OS X/Linux)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mackup makes iTerm2 theme disappear

ahmadawais opened this issue · comments

Hi folks - thanks for this awesome piece of software.

It's been working well for ages, but something happened recently.

Problem: iTerm2 doesn't remember the theme or any custom preferences. Even if I configure it again. If I quite and restart iTerm2 the preferences are gone. (I have also tried custom setting of keep the pref of iTerm2 with automatic saving). Nothing works.

Solution: mackup uninstall ran once, and all of a sudden iTerm2 preferences work. I have the theme and all.

I removed the old mackup backups, and reinstalled everything. iTerm2 and mackup but the moment I ran mackup backup and quit-restart iTerm2 — iTerm2 has again forgotten it's preferences and custom theme.

Caveats:

  • Latest macOS Ventura v13.x.x
  • I have the new Dropbox discussed in #1858 and I'm using custom config but it still doesn't work
[storage]
engine = file_system
path = Library/CloudStorage
directory = Dropbox/Mackup

Can someone please help. Thank you! 🙌

Update:

  • I tried to ignore iterm2 via ~/.mackup.cfg file but iTerm2 still kept losing its preferences
[applications_to_ignore]
iterm2
  • I looked at ~/Library/Preferences/ and com.googlecode.iterm2.plist file was still symlinked to mackup even though I ignored it above and ran mackup backup && mackup restore. So I manually deleted the file and placed a new one. Still no success, iTerm2 loses all the config on quit

  • Finaly, I tried iTerm2 Menu > Install Shell Integration — with the utilities, and somehow my iTerm2 now retains the config/prefs and theme.

I have no idea why.

I have the same problem, I think the mackup somehow delete the preference file in the original location, so once I reopen the item, the profile disappears. Even I install the Shell Integration.

@neuromaancer any thing you could find to fix it?

can't fix it, I tried various ways. I just now keep the iterm open, lol.

I copied everything, deleted mackup, reinstalled, manually configured, and now it works.

I have the same problem.

It keeps resetting everything again and again for some reason beyond my understanding.

I have to configure apps again and again. :(

I reinstalled iTerm.And remove mackup.It has destroyed many of my software configurations, like bartender,appcleaner and etc.

@steveshi exactly, same issue here. What did you end up using then?
@lra is it worth another look?

I had a quick look at issue #1925 ; and I think a replacement iterm2.cfg can fix that - perhaps it'll fix this problem too.

If anyone wants to try, then you need to create a replacement iterm2.cfg (this goes into directory ${HOME}/.mackup)

This is my suggested ${HOME}/.mackup/iterm2.cfg - this will override the app-supplied default version:

[application]
name = iTerm2

[configuration_files]
Library/Preferences/com.googlecode.iterm2.plist
Library/Application Support/iTerm2/DynamicProfiles

The original config tries to backup an iTerm2 directory ${HOME}/.config/iterm2/AppSupport/DynamicProfiles; but on my machine, the parent "AppSupport" is a symlink - the modified config above targets the actual "DynamicProfiles" directory, not the symlinked version.

I met the same problem, I deleted the ~/library/preferences/com.Googlecode.Iterm2. solved the problem.

For me, mackup uninstall seems to remove the symlinks and make every configuration functional again. So, I am using alias macback="yes | mackup backup && yes | mackup uninstall" to backup my settings periodically and then basically restore to the non-symlink version of the config files. Not the most innovative solution - but seems to work well so far.

I've had a comment from the iTerm2 author; who states that symlinking the plist file isn't really supported and won't work - iTerm2 has the capability to read/write preferences to a Cloud Storage location built in.

https://gitlab.com/gnachman/iterm2/-/issues/10962#note_1475925102

Therefore, it may be best to exclude iTerm2 if you're using mackup for your other configurations, and use iTerm2's built-in function as well.

I had the same issue of losing the iterm2 profiles, and cannot find them anymore. Everytime I close and re-open the iterm2, the profile configs will be lost. It is pretty annoying. It would be nice if the author can spend some time to fix this long-lasting bug...

Just dont use mackup. I simply tried to use it, saw errors and now my iterms cant save any changes. Even after mackup is uninstalled.

I have this same issue.

Hey,

I've had a similar issue. Something like this, to be precise:

Backing up Library/Application Support/iTerm2/DynamicProfiles ...
Traceback (most recent call last):
  File "/opt/homebrew/bin/mackup", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/opt/homebrew/lib/python3.12/site-packages/mackup/main.py", line 93, in main
    app.backup()
  File "/opt/homebrew/lib/python3.12/site-packages/mackup/application.py", line 112, in backup
    utils.link(mackup_filepath, home_filepath)
  File "/opt/homebrew/lib/python3.12/site-packages/mackup/utils.py", line 145, in link
    os.symlink(target, link_to)
FileExistsError: [Errno 17] File exists: '/Users/marcin/Library/CloudStorage/****/Mackup/Library/Application Support/iTerm2/DynamicProfiles' -> '/Users/marcin/Library/Application Support/iTerm2/DynamicProfiles'

It's related to AppSupport is a symlink like mentioned earlier.

image

Based on the comment from @jamesrtnz I have created ~/.mackup/iterm.cfg with this config and it works.

[application]
name = iTerm2

[configuration_files]
~/Library/Preferences/com.googlecode.iterm2.plist
~/Library/Application Support/iTerm2/DynamicProfiles

The difference between my code and the one suggested by @jamesrtnz is that I use ~/ in the paths for config files. It didn't work without it.

What's great about this solution is that mackup creates a backup of this config as well, so once you restore it on a new machine it will be there 🎉.

One extra thing that I did was adding the mackup to my crontab to run once a day.

crontab -e
0 0 * * * /usr/bin/env mackup --root --force backup

--root - Allow mackup to be run as superuser
--roce - Force every question asked to be answered with "Yes"