question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pressing `l` to open shell runs `xdg-open` on Linux

See original GitHub issue

Expected 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

  1. Run Dockly on Linux without setting a handler for shell files
  2. 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:closed
  • Created 5 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
zacangercommented, Nov 15, 2018

That works! I’m on a Mac right now, but the change looks like it should be perfectly fine on Linux too. Thanks!

1reaction
lirantalcommented, Nov 15, 2018

@zacanger I pushed a fix. Can you npm install -g dockly@3.8.1 and confirm if the terminal launching works for you now?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to return from xdg-open within a shell script
Just hit Ctrl + L or give the command clear to return to a neat terminal prompt. You could, for aestetic reasons, redirect...
Read more >
Use xdg-open to open a url with a new process
If you don't want to wait, run xdg-open in the background. You can run any shell command in the background by putting an...
Read more >
how to bring application to front with xdg-open
Bring the window to the front with wmctrl -a <WIN> , where <WIN> is the title of the window. List all your managed...
Read more >
xdg-open behaving weirdly. : r/bash
I am trying to create a shortcut that opens up a terminal with the list of my ebooks in the fzf (fuzzy finder)...
Read more >
xdg-open command in Linux with Examples
xdg -open command in the Linux system is used to open a file or URL in the user's preferred application. The URL will...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found