Terminal closes immediately after opening when `bash` does not exist in PATH
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:
- Make the default shell configurable in
configs/*; for example, I personally prefer mksh to bash. A potential hack is to useln -s /usr/local/bin/mksh ~/.local/bin/bash, but that feels ... wrong. - Output an actual error/warning when opening the terminal itself fails (whether in log or in UI), it would help narrow down the problem.
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.
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
bashexisting (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?
where is this called?
https://github.com/pylonide/pylon/blob/9d238f89ace40413e4e29676bcf3340c2cfae555/plugins-server/pylon.ide.terminal/terminal.js#L23
where is this called?
https://github.com/pylonide/pylon/blob/9d238f89ace40413e4e29676bcf3340c2cfae555/plugins-server/pylon.ide.terminal/terminal.js#L23
Note also https://github.com/pylonide/pylon/blob/9d238f89ace40413e4e29676bcf3340c2cfae555/plugins-server/pylon.ide.search/search.js#L156
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)
the lib.ace/* hits are bleeding in from the Ace editor. Other hits are part of this project.