Repository navigation
install.sh: keep the studio launch from draining the curl | sh script (WSL/dash) - #6258
Merged
Merged
Conversation
When installed via 'curl -fsSL https://unsloth.ai/install.sh | sh', the shell reads the script from the pipe on stdin. The optional 'start now' step launches 'unsloth studio' in the foreground, and as a server it inherits and drains the rest of the piped script from stdin. The shell then hits EOF partway through the trailing if/case and dies with 'Syntax error: end of file unexpected (expecting fi)' (reported on WSL, where /bin/sh is dash). Redirect the launch's stdin away from the pipe so the script stays intact. The server does not read stdin and Ctrl+C still works via the controlling terminal.
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the install.sh script to redirect standard input from /dev/null when launching Unsloth Studio. This prevents the foreground server from draining the remainder of the piped script when executed via curl | sh, which would otherwise cause a parsing error. There are no review comments, so I have no additional feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
danielhanchen
added a commit
that referenced
this pull request
Aug 3, 2026
…st (#7774) * Anchor the host-defaults assertions and take the file off the skip list test_install_host_defaults.sh has been quarantined since #7431 and failing for longer, with a recorded reason that covers one of three drifts. None of them is a regression: install.sh, install.ps1 and the README all still behave as the test intends. Every failure comes from how the test carves out the text it greps. Both installers were sliced with a fixed tail. install.sh grew past its 50-line window in #6258 and install.ps1 past its 25-line window in #7be1085, the day after the test landed, so the prompt each assertion looks for sat just above the window. Both now start at the block's own 'In interactive terminals' comment. The README extractor stopped at a '#### Update' heading that was later deleted, so its Launch section silently became the rest of the file and picked up the -H 0.0.0.0 from the remote-access section 137 lines below. It now stops at the next heading of any name. Two assertions could not have failed. setup.sh's launch hint sits at line 2332 while tail -30 covered 2339 onward, so the negative check no longer looked at the hint at all, and 'read' as a needle also matches 'readable' and '_can_read_tty', so the prompt check passed with the prompt deleted. Both are pinned to what they mean to protect; each of the six assertions now fails when its target is removed. With the extraction fixed the file passes 10/10, so it comes off the skip list in run_all.sh, studio-backend-ci.yml and test_ci_shell_suite_coverage.py, which have to change together. * Give the setup.sh window a canary and stop at any heading level The setup.sh launch-hint extraction was the only one of the four with no positive assertion over it. The other three each pin something that must be present, so a broken extraction fails loudly; this one had a lone assert_not_contains, and a negative check over an empty window passes. Renaming the printf label empties it, and the test then stays green with 0.0.0.0 hard-coded in the hint, which is the failure this PR exists to remove. The README extractor's comment promised the next heading of any name while the pattern only matched an h4, so demoting the following heading would widen the window again. * Tighten the comments on the anchored host-defaults assertions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Installing with
curl -fsSL https://unsloth.ai/install.sh | shcan end with:The install itself completes (Studio installs, the prebuilt attaches), but the script dies right at the end. Reported on WSL, where
/bin/shisdash.Cause
With
curl | shthe shell reads the script from the pipe on stdin. The optional "Start Unsloth Studio now?" step launchesunsloth studioin the foreground, and as a long-running server it inherits that same stdin. It drains the rest of the piped script, so the shell reaches EOF partway through the trailingif/caseand reportsunexpected end of file (expecting fi).dash -npasses because the file is syntactically valid, the breakage is purely runtime stdin consumption, which is why it shows up underdash(strict, reads incrementally) and not always underbash.Fix
Redirect the launch's stdin away from the pipe (
</dev/null) so the script stays intact for the shell to finish parsing. The server does not read stdin, and Ctrl+C still works through the controlling terminal.Verification
dash -n install.shandbash -n install.shboth pass.fi); with the stdin redirect the tail is left untouched (0 bytes consumed) and the script finishes.