mackup icon indicating copy to clipboard operation
mackup copied to clipboard

Mackup makes iTerm2 theme disappear

Open ahmadawais opened this issue 1 year ago • 22 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! 🙌

ahmadawais avatar May 08 '23 06:05 ahmadawais

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.

ahmadawais avatar May 08 '23 07:05 ahmadawais

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 avatar Jun 04 '23 16:06 neuromaancer

@neuromaancer any thing you could find to fix it?

ahmadawais avatar Jun 05 '23 08:06 ahmadawais

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

neuromaancer avatar Jun 05 '23 11:06 neuromaancer

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

ahmadawais avatar Jun 05 '23 12:06 ahmadawais

I have the same problem.

steveshi avatar Jun 14 '23 07:06 steveshi

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

I have to configure apps again and again. :(

ahmadawais avatar Jun 15 '23 20:06 ahmadawais

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

steveshi avatar Jun 15 '23 22:06 steveshi

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

ahmadawais avatar Jun 16 '23 13:06 ahmadawais

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.

jamesrtnz avatar Jun 25 '23 08:06 jamesrtnz

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

yunisSong avatar Jul 31 '23 03:07 yunisSong

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.

risjain avatar Aug 04 '23 21:08 risjain

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.

jamesrtnz avatar Aug 04 '23 22:08 jamesrtnz

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...

zhangxiaoyu2046 avatar Nov 26 '23 01:11 zhangxiaoyu2046

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.

Preclowski avatar Jan 11 '24 18:01 Preclowski

I have this same issue.

marcinlesek avatar Jan 16 '24 15:01 marcinlesek

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"

marcinkrzeminski avatar Jan 20 '24 10:01 marcinkrzeminski

even with the last solution given, I've have the error after confirmation. Which is quite annoying.

Wouldn't be possible to fix it with an update or by removing entirely the iterm backup?

jhssilva avatar Jun 07 '24 08:06 jhssilva

It's pretty clear to me you should not be using Mackup for iTerm2 and I'm not sure why people are still trying. Am I wrong?

huyz avatar Jun 07 '24 09:06 huyz

It seems supported. However, either way. Now everything in my system is messed up 👎 My iterm2 doesn't keep any profile or configuration. There are some apps as Tower and Gitkraken that doesn't start.

Not sure what to do at this point to fix it. As try to uninstall and etc, but it has probably created shortcuts etc that changes the configuration.

Update Short story, the mackup created multiple links in /Library/Preferences/ to a folder that was configured before, as there was a change in configuration in the storage it probably when uninstalling the mackup it didn't unbind this links. (I'm not sure if I should call them symlinks) For future viewers, you can fix this issue, by removing this links, you can see them via the following command: ls -l ~/Library/Preferences/

jhssilva avatar Jun 08 '24 09:06 jhssilva

THE WORSTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT

FUCKIGN YAWA NGA PACKAGE EVER, FUCKING DELETE THIS REPO, BULLSHIT

phojie avatar Aug 22 '24 23:08 phojie

Yeah I had to restore settings too. But that's what backups are for. I do agree that this project is very dangerous. And it's been clearly abandoned by the creator who probably realized it was a design mistake in the first place but can't admit it yet: Most apps do not work with symlinks and it was wrong to assume that they all do.

huyz avatar Aug 25 '24 02:08 huyz