Skip to content

Remote terminal crashes when env contains functions #45425

@JotaRata

Description

@JotaRata

Reproduction steps

  1. Connect to a remote host that has bash functions defined at login time (via /etc/environment, PAM, etc) and make sure the env command returns something like:
    MY_FUNCTION()=() {...}
  2. Start a new remote terminal
  3. Zed will attempt to run bash -c "cd project/direcotry && exec env "
  4. The terminal will crash because bash -c is parsing invalid syntax.

Current vs. Expected behavior

Current behavior:

Image

The function causing the error is highlighted in yellow

Expected behavior:

The terminal should start, regardless of syntax errors in the parsed env variables

Zed version and system specs

Zed 0.217.2+stable
OS: Arch Linux 6.18.1-arch1-2
Architecture: x86-64

Attach Zed log file

No response

Relevant Zed settings

Using default settings

Relevant Keymap

No response

(for AI issues) Model provider details

No response

If you are using WSL on Windows, what flavor of Linux are you using?

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:integrations/terminalFeedback for terminal integration, shell commands, etcfrequency:uncommonBugs that happen for a small subset of users, special configurations, rare circumstances, etcplatform:remoteRemote development, SSH and zed-remote-serverpriority:P2Average run-of-the-mill bugsstate:needs reproNeeds reproduction steps / someone to reproduce

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions