Skip to content

Per-project Claude Code binary UI + session env hygiene - #6

Merged
omartelo merged 3 commits into
mainfrom
feat/per-project-bin-and-env-fixes
Jul 13, 2026
Merged

omartelo merged 3 commits into
mainfrom
feat/per-project-bin-and-env-fixes

Conversation

@omartelo

@omartelo omartelo commented Jul 12, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Settings › Project group: per-project claude.bin override UI. Backend resolution (project → global → $PATH) already existed; this adds the missing surface. Empty input inherits the global path (shown as placeholder).
  • AppImage env leak, round 2 (completes fix: strip AppImage runtime vars from PTY shell env #3): childEnv now gates on APPDIR — deb/rpm/dev environments pass through byte-identical — and inside an AppImage it drops the AppImageLauncher vars (TARGET_APPIMAGE, REDIRECT_APPIMAGE, DESKTOPINTEGRATION) and the WEBKIT_DISABLE_* pair, plus value-scrubs mount entries out of every colon-separated path list (LD_LIBRARY_PATH, PATH, XDG_DATA_DIRS, GDK_PIXBUF_MODULE_FILE, future ones). User-set entries survive verbatim — a pre-existing LD_LIBRARY_PATH suffix keeps working. Motivation: the bundled Ubuntu libs break CGO links (go build inside a lich terminal fails with pcre2/gstreamer undefined references) and GTK apps launched from the terminal.
  • GDK_BACKEND leak (all package formats): main.go snapshots os.Environ() before forcing GDK_BACKEND=x11; sessions inherit the launch environment, not our GTK workaround.
  • Dev app ID: task dev (LICH_DEV=1) registers lichdev as GTK application ID. Before, GTK single-instance made the dev window silently never open while an installed lich was running.

Test plan

  • go test -race ./... — terminal package at 80.1% coverage, 5 new/updated env tests (untouched outside AppImage, mount scrub, user suffix preserved, dropped-when-empty, New wires cleaned env + TERM)
  • go vet, gofmt, binary links
  • cd frontend && pnpm build && pnpm test (193 tests)

omartelo added 3 commits July 12, 2026 19:27
The settings sidebar gains a "Project" group listing every open project
with its own claude.bin input. An empty value inherits the global path —
the backend already resolved project → global → $PATH (store.ClaudeBin),
the override just had no UI.
Three leaks reached spawned PTY shells:

- The AppImage runtime env broke tooling run from a lich terminal: the
  bundled Ubuntu libs on LD_LIBRARY_PATH fail CGO links and GTK apps on
  other distros, GDK_PIXBUF_MODULE_FILE points into the mount, and the
  WEBKIT_DISABLE_* pair would run any WebKitGTK app without its sandbox.
  childEnv now gates on APPDIR (deb/rpm/dev envs pass through untouched),
  drops the AppImageLauncher vars too, and value-scrubs mount entries out
  of every colon-separated path list, keeping user-set entries verbatim.
- The GDK_BACKEND=x11 forced at startup leaked to children in every
  package format. main.go snapshots os.Environ() before the tweak and
  terminal.New derives the session env from that snapshot, once.
- Dev instances now register a distinct GTK application ID (lichdev via
  LICH_DEV): GTK treats a second process with the same ID as a remote
  instance and never creates its window, so task dev silently failed to
  open while an installed lich was running.
Mirror the global section's layout: a single "Custom path" block whose
description explains the override and the inherit-when-empty behavior,
with each open project as a labeled row inside.
@omartelo
omartelo merged commit 4a60491 into main Jul 13, 2026
1 check passed
@omartelo
omartelo deleted the feat/per-project-bin-and-env-fixes branch July 14, 2026 15:58
omartelo added a commit that referenced this pull request Nov 8, 2026
…double click (#1063)

Picks up lichdotdev/gio #3 to #6: a 400 ms double click window, the flip
model on Windows, partial redraw into a framebuffer the renderer keeps
instead of trusting the buffer age, and upstream main.
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.

1 participant