Skip to content

Fix "Failed to start new session" for users with a fetch installed #150

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 30, 2025

Conversation

Ahmad-A0
Copy link
Contributor

The way that the default_program used for execution is found and set to the config, was by sourcing .bashrc or .zshrc then running which claude. Only redirecting stderr to /dev/null like this.

shellCmd = "source ~/.zshrc 2>/dev/null || true; which claude"
shellCmd = "source ~/.bashrc 2>/dev/null || true; which claude"

For users that have a fetch script installed, or any configuration where something is written to stdout during initialisation the whole output would be set as the default_program, causing the "Failed to start new session ..." error for new users.

{
  "default_program": "\u001b[36m                         \u001b[33maa0\u001b[31m@\u001b[32maa7\u001b[0m ~\u001b[0m\n    \u001b[36m       /\\                \u001b[36m󰣇  \u001b[34mSystem\u001b[0m        Arch Linux\n    \u001b[36m      /  \\               \u001b[36m  \u001b[34mKernel\u001b[0m        Linux 6.14.9-zen1-1-zen (x86_64)\n    \u001b[36m     /\\   \\              \u001b[36m  \u001b[34mShell\u001b[0m         zsh\n    \u001b[36m    /      \\             \u001b[36m  \u001b[34mUptime\u001b[0m        1 day, 8 hours, 26 minutes\n    \u001b[36m   /   ,,   \\            \u001b[36m  \u001b[34mDesktop\u001b[0m       Hyprland (Wayland)\n    \u001b[36m  /   |  |  -\\           \u001b[36m  \u001b[34mMemory\u001b[0m        5.26 GiB / 7.52 GiB (\u001b[36m70%\u001b[0m)\n    \u001b[36m /_-''    ''-_\\          \u001b[36m󱥎  \u001b[34mStorage (/)\u001b[0m   150.73 GiB / 217.29 GiB (\u001b[36m69%\u001b[0m)\n    \u001b[36m                         \u001b[36m  \u001b[34mColors\u001b[0m        \u001b[34m  \u001b[36m  \u001b[32m  \u001b[33m  \u001b[31m  \u001b[35m  \u001b[0m\n/usr/bin/claude",
  "auto_yes": false,
  "daemon_poll_interval": 1000,
  "branch_prefix": "aa0/"
}

The fix redirects both stdout and stderr to /dev/null to stop this from happening.

I believe this should fix #132 #96 and #115.

Copy link

github-actions bot commented Jun 29, 2025

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@Ahmad-A0
Copy link
Contributor Author

I have read the CLA Document and I hereby sign the CLA

Copy link
Member

@mufeez-amjad mufeez-amjad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for putting up a fix! 🙏

@mufeez-amjad mufeez-amjad merged commit 4b51527 into smtg-ai:main Jun 30, 2025
7 of 8 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jun 30, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Failed to start new session after fresh install
2 participants