lra / mackup

Keep your application settings in sync (OS X/Linux)
GNU General Public License v3.0
14.55k stars 932 forks source link

Mackup makes iTerm2 theme disappear #1916

Open ahmadawais opened 1 year ago

ahmadawais commented 1 year ago

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:

Can someone please help. Thank you! 🙌

ahmadawais commented 1 year ago

Update:

I have no idea why.

neuromaancer commented 1 year ago

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.

ahmadawais commented 1 year ago

@neuromaancer any thing you could find to fix it?

neuromaancer commented 1 year ago

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

ahmadawais commented 1 year ago

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

steveshi commented 1 year ago

I have the same problem.

ahmadawais commented 1 year ago

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

I have to configure apps again and again. :(

steveshi commented 1 year ago

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

ahmadawais commented 1 year ago

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

jamesrtnz commented 1 year ago

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.

yunisSong commented 1 year ago

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

risjain commented 1 year ago

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.

jamesrtnz commented 1 year ago

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.

zhangxiaoyu2046 commented 10 months ago

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

Preclowski commented 8 months ago

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.

marcinlesek commented 8 months ago

I have this same issue.

marcinkrzeminski commented 8 months ago

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"

jhssilva commented 3 months ago

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?

huyz commented 3 months ago

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?

jhssilva commented 3 months ago

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/

phojie commented 1 month ago

THE WORSTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT

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

huyz commented 1 month ago

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.