Pressing `l` to open shell runs `xdg-open` on Linux
See original GitHub issueExpected Behavior
The script should be spawned.
Actual Behavior
The script is opened with xdg-open on Linux, and the default handler on Mac (XCode, I think). On my computer, xdg-open ends up trying to open the script in Chromium, which then tries to download the script.
Related issues: #76, #55, possibly #65.
Rather than using open here, I believe child_process.spawn
would work. opn
calls open
on Darwin, xdg-open
if it’s available, and whatever the Windows equivalent is on Windows. For a shell script, that could be anything from an IDE to spawning a terminal that runs Vim to not even having a good default (like on my machine).
Using child_process.spawn
would mean running in the same window rather than trying to open a new terminal. child_process.exec
could be used to open a new terminal, but would require a good bit of logic (check platform, try to figure out the correct terminal, etc).
Steps to Re-produce the Problem
- Run Dockly on Linux without setting a handler for shell files
- Try to launch a shell through Dockly
Context
- Operating System:
- Node.js version (run
node --version
): 10.12.0 - Package version: 3.8.0
- Docker version (run
docker --version
): 10.06.1-ce - Is docker installed locally? Yes
- Do you have containers created? Yes
- Does this file exists
/var/run/docker.sock
? Yes - Output of
docker info
: Not relevant
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (4 by maintainers)
Top GitHub Comments
That works! I’m on a Mac right now, but the change looks like it should be perfectly fine on Linux too. Thanks!
@zacanger I pushed a fix. Can you
npm install -g dockly@3.8.1
and confirm if the terminal launching works for you now?