codex - 💡(How to fix) Fix Remote SSH connection fail if remote default shell use fish [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#18183Fetched 2026-04-17 08:31:43
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Author
Participants
Timeline (top)
labeled ×3

Error Message

When trying to connect to a remote machine with fish set as default shell, it would error out. Local Shell is still fish, does not affect. Only remote destination's shell setting to fish would lead to such error.

Code Example

ish: Missing end to balance this if statement
if command -v codex >/dev/null 2>&1; then exit 0; fi; exit 86
^^

---

chsh -s /usr/bin/fish $USER
RAW_BUFFERClick to expand / collapse

What version of the Codex App are you using (From “About Codex” dialog)?

Version 26.415.20818 (1727)

What subscription do you have?

ChatGPT Pro

What platform is your computer?

Darwin 24.6.0 arm64 arm

What issue are you seeing?

When trying to connect to a remote machine with fish set as default shell, it would error out.

<img width="411" height="179" alt="Image" src="https://github.com/user-attachments/assets/c64ffc7b-18e6-4608-b1ef-008d4c2fe5d8" />
ish: Missing end to balance this if statement
if command -v codex >/dev/null 2>&1; then exit 0; fi; exit 86
^^

Setting remote shell to bash again, works.

Local Shell is still fish, does not affect. Only remote destination's shell setting to fish would lead to such error.

Local macOS, Remote Linux.

What steps can reproduce the bug?

Set default shell to fish on remote machine:

chsh -s /usr/bin/fish $USER

Open Codex App, try to connect, then fail.

What is the expected behavior?

No response

Additional information

No response

extent analysis

TL;DR

The issue is likely due to the Codex App not supporting the fish shell on remote Linux machines, and a workaround is to use a different shell like bash.

Guidance

  • The error message suggests a syntax issue with the if statement, which may be due to the fish shell's different syntax compared to bash.
  • To verify, try running the command command -v codex directly on the remote machine with fish shell to see if it produces any errors.
  • As a temporary workaround, setting the remote shell to bash using chsh -s /bin/bash $USER may resolve the issue.
  • It's also worth checking if there are any configuration options in the Codex App to specify the shell to use for remote connections.

Example

No code snippet is provided as the issue is more related to shell configuration and compatibility.

Notes

The issue seems to be specific to the combination of the Codex App, fish shell, and remote Linux machines. The fact that it works with bash shell suggests a compatibility issue.

Recommendation

Apply workaround: use a different shell like bash on the remote machine, as the Codex App may not support fish shell on Linux. This is because the error message indicates a syntax issue that is likely due to the difference in shell syntax.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING