Skip to content

Signal blocking-script tabs so the shell can skip the interactive profile#457

Merged
sbertix merged 2 commits into
mainfrom
sbertix/gh-437
Jun 22, 2026
Merged

Signal blocking-script tabs so the shell can skip the interactive profile#457
sbertix merged 2 commits into
mainfrom
sbertix/gh-437

Conversation

@sbertix

@sbertix sbertix commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

Blocking-script tabs (user scripts, archive, delete) opened a normal interactive surface, so the user's shell profile fully initialized (prompt frameworks, plugins, banners like fastfetch) before the script ran, with no signal to gate on. This exposes that signal as surface environment variables.

Markers

Every blocking-script surface exports:

  • SUPACODE_BLOCKING_SCRIPT=1
  • SUPACODE_SCRIPT_KIND — the script kind (run/test/deploy/lint/format/custom), or archive/delete for lifecycle tabs

User-defined script tabs additionally export:

  • SUPACODE_SCRIPT_ID — the script's UUID
  • SUPACODE_SCRIPT_SCOPErepo or global, resolved repo-wins (omitted only when the id resolves to neither, e.g. a since-deleted deeplink target)

Users can then gate their rc, e.g.:

# ~/.zshrc — skip prompt/plugins/banner for transient script tabs
[[ -n "$SUPACODE_BLOCKING_SCRIPT" ]] && return

How it works

  • The blocking-script kind is recorded into blockingScripts[tabId] before the surface is built, so surfaceEnvironment can read it and emit the markers. Scope is resolved locally against this worktree's repositorySettings vs the global scripts.
  • For remote (SSH) worktrees the markers can't ride the local surface environment across the ssh boundary, so they are applied via an env prefix on the remote login-shell invocation (SSHCommand). This sets them before the first remote login shell sources its profile, where a plain export inside the -c script would only take effect after the profile had already loaded.

Testing

  • make build-app green
  • make test green; new coverage for the marker env (user/global/lifecycle kinds, scope resolution), the remote env prefix ordering, and the empty-environment case

Closes #437

sbertix added 2 commits June 22, 2026 19:33
Blocking-script tabs (user scripts, archive, delete) opened a normal
interactive surface, so the user's shell profile fully initialized
(prompt, plugins, banners) before the script ran, with no signal to
gate on.

Emit SUPACODE_BLOCKING_SCRIPT=1 on every blocking-script surface, plus
SUPACODE_SCRIPT_KIND (the script kind, or archive/delete for lifecycle
tabs) and, for user-defined scripts, SUPACODE_SCRIPT_ID and
SUPACODE_SCRIPT_SCOPE (repo/global, resolved repo-wins). The kind is
recorded before the surface is built so surfaceEnvironment can read it.
Local surfaces carry the SUPACODE_BLOCKING_SCRIPT markers via the
surface environment, but those don't cross the ssh boundary, so remote
worktree script tabs had no signal. Apply the same markers via an env
prefix on the remote login-shell invocation (SSHCommand) so the first
login shell inherits them before sourcing its profile, where a plain
export inside the -c script would run only after the profile loaded.
Scope resolution is shared with the local path via
blockingScriptEnvironment(for:).
@sbertix sbertix enabled auto-merge (squash) June 22, 2026 19:08
@tuist

tuist Bot commented Jun 22, 2026

Copy link
Copy Markdown

🛠️ Tuist Run Report 🛠️

Builds 🔨

Scheme Status Duration Commit
supacode 1m 45s fcb29986c

@sbertix sbertix merged commit 39e4b9f into main Jun 22, 2026
1 check passed
@sbertix sbertix deleted the sbertix/gh-437 branch June 22, 2026 19:16
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.

Feature request: signal blocking-script tabs so the shell can skip the interactive profile

1 participant