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

Terminal closes immediately after opening when bash does not exist in PATH #424

Open
darkuranium opened this issue Jan 9, 2025 · 5 comments

Comments

@darkuranium
Copy link

I'm trying out the IDE, but I ran into a trouble with opening the terminal --- it immediately closes.

I've managed to spot an error message which sometimes flashes for just 1 frame: "No such file or directory". Following that rabbit hole, I ultimately found the problem to be the implicit assumption in various places in the code on bash existing (which does not exist by default in FreeBSD).

I think two things would be useful here:

  1. Make the default shell configurable in configs/*; for example, I personally prefer mksh to bash.
    A potential hack is to use ln -s /usr/local/bin/mksh ~/.local/bin/bash, but that feels ... wrong.
  2. Output an actual error/warning when opening the terminal itself fails (whether in log or in UI), it would help narrow down the problem.
@exsilium
Copy link
Collaborator

I've ran into this as well when trying out on different OS configurations, indeed the bash hardcoding is limiting and should be configurable. If invalid configuration is set, there should be a warning/error surfaced to the userland.

@Kreijstal
Copy link

I'm trying out the IDE, but I ran into a trouble with opening the terminal --- it immediately closes.

I've managed to spot an error message which sometimes flashes for just 1 frame: "No such file or directory". Following that rabbit hole, I ultimately found the problem to be the implicit assumption in various places in the code on bash existing (which does not exist by default in FreeBSD).

I think two things would be useful here:

1. Make the default shell configurable in `configs/*`; for example, I personally prefer mksh to bash.
   A potential hack is to use `ln -s /usr/local/bin/mksh ~/.local/bin/bash`, but that feels ... wrong.

2. Output an actual error/warning when opening the terminal itself fails (whether in log or in UI), it would help narrow down the problem.

where is this called?

@exsilium
Copy link
Collaborator

where is this called?

@darkuranium
Copy link
Author

where is this called?

Note also

args.command = "bash";

Plus there are a ton of places where bash is hardcoded in plugins-client:

$ grep -r 'bash' plugins-client
plugins-client/lib.ace/www/worker/worker-language.js:        command: "bash",
plugins-client/lib.ace/www/worker/worker-language.js:        argv: ["bash", "-c", command],
plugins-client/lib.ace/www/mode/mode-slim.js:        bash: require("./sh").Mode,
plugins-client/lib.ace/www/mode/mode-markdown.js:        bash: require("./sh").Mode,
plugins-client/ext.linereport/linereport_base.js:        command: "bash",
plugins-client/ext.linereport/linereport_base.js:        argv: ["bash", "-c", command],
plugins-client/pylon.core/www/core/util.js:    "bash": "application/x-sh",
plugins-client/ext.gotofile/search.js:    "pl": 1, "pm": 2, "ps1": 1, "cfm": 1, "sql": 2, "sh": 1, "bash": 1,

(some like "bash": "application/x-sh" are obviously false positives here, bu tmany are not)

@exsilium
Copy link
Collaborator

the lib.ace/* hits are bleeding in from the Ace editor. Other hits are part of this project.

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

No branches or pull requests

3 participants