Skip to content

Commit c97fd9e

Browse files
committed
Fix iTerm2 "Cannot Run Script: __pycache__ is malformed" startup dialog
install.sh now removes any stray __pycache__ from the AutoLaunch folder — iTerm2 tries to run every entry there, and a bytecode cache dir (created if anything imports the deployed script) triggers the dialog on every launch. Also ignore TODO.md (maintainer notes, not for publication).
1 parent 0c51ce6 commit c97fd9e

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Local config (may contain host names)
22
config.json
33

4+
# Maintainer notes — not for publication
5+
TODO.md
6+
47
# Python
58
__pycache__/
69
*.pyc

install.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ mkdir -p "$AUTOLAUNCH"
2424
cp "$SRC" "$DEST"
2525
ok "Installed → $DEST"
2626

27+
# Stray __pycache__ here makes iTerm2 show a "Cannot Run Script: malformed"
28+
# dialog on every launch (it tries to run everything in AutoLaunch). It appears
29+
# if anything imports the deployed script, e.g. running tests against it.
30+
rm -rf "$AUTOLAUNCH/__pycache__"
31+
2732
# 3. Optional dependency: pngpaste (osascript fallback exists, but pngpaste is nicer).
2833
if command -v pngpaste >/dev/null 2>&1; then
2934
ok "pngpaste found ($(command -v pngpaste))"

0 commit comments

Comments
 (0)