Skip to content

Remote VM session fails before SSH: bash exec tries to run trap #737

Description

@ivanrychkov

What happened?

When opening a remote VM session over SSH, Supacode fails before SSH starts with:

bash: line 0: exec: trap: not found

Regular ssh remote-host works. The issue appears to be in the Supacode/GhosttyKit launch command quoting, not in SSH, the remote host, shell startup files, or zmx.

The generated command appears to pass the script to bash -c incorrectly.

Bad observed pattern:

bash -c exec -l trap 'exit 130' INT; ssh ...

Expected pattern:

bash -c 'trap "exit 130" INT; exec ssh ...'

Settings/workarounds already tried:

  • remoteSessionPersistenceEnabled=false
  • terminalHibernationEnabled=false
  • terminateSessionsOnQuit=false
  • stable and tip update channels
  • clearing the lingering SSH ControlMaster mux/socket

The failure still occurs.

Steps to reproduce

  1. Configure a remote repository/session over SSH, e.g. remote-host/home/user.
  2. Open the remote VM/session in Supacode.
  3. Supacode/GhosttyKit fails before the SSH session starts.
  4. Observe the error:
bash: line 0: exec: trap: not found

Minimal local reproduction of the bad quoting shape:

/bin/bash --noprofile --norc -c "exec -l trap 'exit 130' INT"

Output:

/bin/bash: line 0: exec: trap: not found

Supacode version and build

Version 0.10.6 (1784763905)

macOS version

macOS 26.5

System locale

en_US@rg=ruzzzz

Mac hardware

M3 Pro (Apple silicon / ARM)

Relevant logs or screenshots

Relevant launch-command excerpt shows `/bin/bash --noprofile --norc -c exec -l trap 'exit 130' INT; /usr/bin/ssh ...`, which makes `trap` become the command passed to `exec` instead of a shell builtin inside the `bash -c` script.

Are you planning to fix this yourself?

  • I intend to open a pull request once this is confirmed and marked ready.

Before submitting

  • I searched existing issues and this is not a duplicate.
  • I am on the latest available version of Supacode.
  • I understand pull requests are closed until the issue is marked ready.
  • I agree to follow this project's Code of Conduct.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions