Skip to content

Conversation

veracioux
Copy link
Contributor

@veracioux veracioux commented Oct 8, 2025

I noticed a few things to improve in the current implementation of the shell
commands, so I went ahead and did it.

Changes

  • Replaced scripts map with structured invocations map for clearer
    per-shell configuration
  • Removed eval ${input.command} which is error-prone and not general
  • Untangled bash and zsh rc file sourcing; previously it was sourcing both files
    for either shell, which could cause unintended side-effects

Verification

Ran the following:

SHELL=fish opencode
SHELL=sh opencode
SHELL=bash opencode
SHELL=zsh opencode
SHELL=nu opencode
SHELL= opencode (shows an error notification in the TUI, same as the current production version)

and within those TUI instances running the following command:

!echo "$SHELL" (!echo ($env.SHELL) for nu): prints the correct value

Tried the following edge cases in a random sample of shells:

! (empty shell command)
!cat
!bash
!| cat

None of those block, and have identical behavior as the production version.

- Replace scripts map with structured invocations map for clearer
  per-shell configuration
- Remove `eval ${input.command}` which is error-prone and not general
- Untangle bash and zsh rc file sourcing
@veracioux veracioux force-pushed the feature/more-robust-shell branch from f95cadf to 9ab9e15 Compare October 8, 2025 23:28
@veracioux
Copy link
Contributor Author

Rebased.

@rekram1-node rekram1-node merged commit dbe9fd0 into sst:dev Oct 13, 2025
3 checks passed
@rekram1-node
Copy link
Collaborator

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants