Skip to content

Non-empty PS0 causes bash shell to not respond #2350

@callumwalker

Description

@callumwalker

Describe the bug

When the environment variable PS0 is set to a non-empty string shell commands freeze and never return

e..g.

env -i PS0=a copilot

❯ test bash

● Test bash execution (shell)
  │ echo "Bash is working!" && uname -a
  └ 1 line...

✗ Read shell output Waiting up to 10 seconds for command output
  └ Invalid shell ID: 0. Please supply a valid shell ID to read output from.

    <no active shell sessions>

In the shell-logs we have

2026-03-27T18:16:43.719Z [INFO] Shell session created: type=bash, cwd=/Servers/bcde, pid=486114
2026-03-27T18:16:43.719Z [INFO] initializeShellEnvironment: sending init command (28 chars)
2026-03-27T18:16:43.719Z [INFO] executeCommand: command="PS1=\"\";PS2=\"\";unset HISTFILE", timeout=60000ms
2026-03-27T18:16:43.719Z [INFO] tryStartCommand: wrappedLength=213, shell=bash
2026-03-27T18:16:43.734Z [RAW] bash-5.2$
bash-5.2$             {
>                 echo ___BEGIN___COMMAND_OUTPUT_MARKER___
>                 PS1="";PS2="";unset HISTFILE
>
2026-03-27T18:16:43.734Z [NORMALIZED] bash-5.2$
bash-5.2$             {
>                 echo ___BEGIN___COMMAND_OUTPUT_MARKER___
>                 PS1="";PS2="";unset HISTFILE
>
2026-03-27T18:16:43.833Z [RAW]      EC=$?
>                 echo "___BEGIN___COMMAND_DONE_MARKER___$EC"
>             }
a___BEGIN___COMMAND_OUTPUT_MARKER___
___BEGIN___COMMAND_DONE_MARKER___0

2026-03-27T18:16:43.833Z [NORMALIZED]      EC=$?
>                 echo "___BEGIN___COMMAND_DONE_MARKER___$EC"
>             }
a___BEGIN___COMMAND_OUTPUT_MARKER___
___BEGIN___COMMAND_DONE_MARKER___0

When running env -i PS0= copilot I get

❯ test bash

● Test bash (shell)
  │ echo "Bash is working!" && pwd && date
  └ 4 lines...

● Bash is working! ✅

Affected version

GitHub Copilot CLI 1.0.12

Steps to reproduce the behavior

env -i PS0=a copilot
test bash

Expected behavior

No response

Additional context

GitHub Copilot CLI 1.0.12
GNU bash, version 5.2.26(1)-release (x86_64-redhat-linux-gnu)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions