fix: dont override $.prefix setting defined via envs, revert `env.S… - #1261
Merged
Conversation
antongolub
force-pushed
the
fix-shell-init
branch
from
July 9, 2025 05:08
cd7d2ff to
4483443
Compare
antonmedv
approved these changes
Jul 9, 2025
revert: `env.SHELL` as default
antongolub
force-pushed
the
fix-shell-init
branch
from
July 9, 2025 07:11
4483443 to
0e5bc59
Compare
$.prefix setting defined via envs, Revert `env.S…$.prefix setting defined via envs, revert `env.S…
antonmedv
approved these changes
Jul 9, 2025
There was a problem hiding this comment.
Pull Request Overview
This PR makes prefix and postfix optional in the core API, updates default handling, and ensures existing $.prefix/$.postfix values from the environment are not overridden. Key changes include:
- Marking
prefixandpostfixas optional and removing their empty-string defaults - Updating
fullCmdto safely handle undefinedprefix/postfix - Extending the initial
$destructuring to includeprefixandpostfix
Reviewed Changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/core.ts | Made prefix/postfix optional, updated defaults, fullCmd, and destructuring logic |
| build/core.cjs | Mirrored src/core.ts changes in compiled output |
| .size-limit.json | Bumped size limits to reflect the new build |
| useBash() | ||
| if (isString(shell)) $.shell = shell | ||
| if (isString(prefix)) $.prefix = prefix | ||
| if (isString(postfix)) $.postfix = prefix |
There was a problem hiding this comment.
This line assigns prefix to $.postfix instead of postfix. It should be $.postfix = postfix.
Suggested change
| if (isString(postfix)) $.postfix = prefix | |
| if (isString(postfix)) $.postfix = postfix |
| useBash(); | ||
| if ((0, import_util.isString)(shell)) $.shell = shell; | ||
| if ((0, import_util.isString)(prefix)) $.prefix = prefix; | ||
| if ((0, import_util.isString)(postfix)) $.postfix = prefix; |
There was a problem hiding this comment.
This assignment uses prefix instead of postfix. Update to $.postfix = postfix.
Suggested change
| if ((0, import_util.isString)(postfix)) $.postfix = prefix; | |
| if ((0, import_util.isString)(postfix)) $.postfix = postfix; |
antongolub
force-pushed
the
fix-shell-init
branch
from
July 9, 2025 10:32
a5fef9d to
3820647
Compare
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.
closes #1260
Fixes setting
$.prefixasZX_PREFIX=""env.