Skip to content
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

Adapt the bash of busybox. #170868

Open
fxzxmic opened this issue Jan 4, 2023 · 6 comments · Fixed by #170870
Open

Adapt the bash of busybox. #170868

fxzxmic opened this issue Jan 4, 2023 · 6 comments · Fixed by #170870
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug good first issue Issues identified as good for first-time contributors help wanted Issues identified as good community contribution opportunities linux Issues with VS Code on Linux terminal-shell-bash An issue in the terminal specific to bash
Milestone

Comments

@fxzxmic
Copy link

fxzxmic commented Jan 4, 2023

  • VSCode Version: 1.74.2
  • Local OS Version: Windows 11 Build 22621
  • Remote OS Version: Alpine Linux v3.17
  • Remote Extension/Connection Type: WSL
  • Logs:

Steps to Reproduce:

  1. Start a terminal.
  2. image

I use busybox bash as /bin/bash (still busybox ash in essence), which is why there is no .bashrc.
I hope vs code server can judge whether it is a real bash before using it, if not, treat the bash as ash.

Does this issue occur when you try this locally?: No
Does this issue occur when you try this locally and all extensions are disabled?: No

@meganrogge meganrogge self-assigned this Jan 9, 2023
@meganrogge meganrogge added bug Issue identified by VS Code Team member as probable bug terminal-shell-bash An issue in the terminal specific to bash labels Jan 9, 2023
@meganrogge meganrogge added this to the January 2023 milestone Jan 9, 2023
meganrogge added a commit that referenced this issue Jan 9, 2023
meganrogge added a commit that referenced this issue Jan 9, 2023
* fix #170868

* Update src/vs/workbench/contrib/terminal/browser/media/shellIntegration-bash.sh

Co-authored-by: Daniel Imms <2193314+Tyriar@users.noreply.github.com>

Co-authored-by: Daniel Imms <2193314+Tyriar@users.noreply.github.com>
@VSCodeTriageBot VSCodeTriageBot added unreleased Patch has not yet been released in VS Code Insiders insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Jan 9, 2023
@fxzxmic
Copy link
Author

fxzxmic commented Jan 10, 2023

In fact, busybox bash/ash does not support the builtin command. I've found the way to set /bin/ash as the default shell of vscode instead of the automatically detected /bin/bash, so I don't know if this problem still needs to be fixed.

@Tyriar
Copy link
Member

Tyriar commented Jan 10, 2023

Thanks, it's still an issue then. We should detect if it's busybox either before injecting the shell integration or at the start of the script.

@Tyriar Tyriar reopened this Jan 10, 2023
@VSCodeTriageBot VSCodeTriageBot removed the insiders-released Patch has been released in VS Code Insiders label Jan 10, 2023
@meganrogge
Copy link
Contributor

I'll create another issue for the case when there's no .bashrc file so that gets verified

@fxzxmic
Copy link
Author

fxzxmic commented Jan 12, 2023

Check whether $BASH_VERSION exists? This is probably the easiest way.

When I delete the code for reading .bashrc and the builtin command, it still reports an error.
image
image
It seems that busybox bash/ash is not compatible with this script.

Perhaps there could be an injection script for busybox bash/ash?

@meganrogge meganrogge modified the milestones: January 2023, Backlog Jan 23, 2023
@Tyriar Tyriar added help wanted Issues identified as good community contribution opportunities linux Issues with VS Code on Linux good first issue Issues identified as good for first-time contributors labels Dec 5, 2023
@Tyriar
Copy link
Member

Tyriar commented Dec 5, 2023

This is available for contributions. I believe all this needs is an if here to exit early if it is busybox:

# Prevent the script recursing when setting up
if [[ -n "${VSCODE_SHELL_INTEGRATION:-}" ]]; then
builtin return
fi

It needs to be tested of course and be a low risk change for regular bash.

@fxzxmic
Copy link
Author

fxzxmic commented Mar 6, 2024

Perhaps we should exit the script when we detect that this is not a true bash, or only perform some necessary injections. Otherwise, it would be too complicated to fully adapt to Busybox's bash.

This issue is being transferred. Timeline may not be complete until it finishes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug good first issue Issues identified as good for first-time contributors help wanted Issues identified as good community contribution opportunities linux Issues with VS Code on Linux terminal-shell-bash An issue in the terminal specific to bash
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants