tjx666 / open-in-external-app

Open file with external application in VSCode
https://marketplace.visualstudio.com/items?itemName=YuTengjing.open-in-external-app
MIT License
52 stars 9 forks source link

Ubuntu opening svg in inkscape #51

Open RuuddR opened 1 year ago

RuuddR commented 1 year ago

Description

When I try to open a svg file in inkscape using this plugin from vscode on ubuntu. Then inkscape has no icons, they are all orange

Extension Version

0.9.1

VS Code Version

Version: 1.74.3
Commit: 97dec172d3256f8ca4bfb2143f3f76b503ca0534
Date: 2023-01-09T16:57:40.428Z
Electron: 19.1.8
Chromium: 102.0.5005.167
Node.js: 16.14.2
V8: 10.2.154.15-electron.0
OS: Linux x64 5.15.0-58-generic snap
Sandboxed: No

Extension Settings

"openInExternalApp.openMapper": [
    {
      "extensionName": "svg",
      "apps": "/usr/bin/inkscape"
    },
  ]

Logs, Notifications, Screenshots, Screen Recording etc

image

tjx666 commented 1 year ago

What happen when run /usr/bin/inkscape fileToOpen.svg

RuuddR commented 1 year ago

When doing that inkscape opens up normally with the file loaded and with icons. So that works as expected

tjx666 commented 1 year ago

try setting:

{
      "extensionName": "svg",
      "apps": [
        {
          "title": "inkscape",
          "shellCommand": "/usr/bin/inkscape ${file}"
        }
      ]
    },
RuuddR commented 1 year ago

I changed that and it still does the same thing unfortunately. What I find weird is that it is executing the command right and when I paste that exact command in a terminal in vscode it opens up normally

These are my settings now:

"openInExternalApp.openMapper": [
    {
      "extensionName": "svg",
      "apps": [
        {
          "title": "inkscape",
          "shellCommand": "/usr/bin/inkscape ${file}"
        }
      ]
    },
  ]

When I go to preferences in inkscape and change the icon theme then inkscape crashes and I get the following message in vscode open file by shell command failed, execute: "/usr/bin/inkscape /path/to/file/icon.svg"

tjx666 commented 1 year ago

is you file path contains space? can you provide the screenshot or log string like following?

image
RuuddR commented 1 year ago

It doesn't look like it

parsed args: [
    {
        "$mid": 1,
        "external": "file:///home/ruud/Documents/Company/app/frontend/src/assets/controller_black_24dp.svg",
        "path": "/home/ruud/Documents/Company/app/frontend/src/assets/controller_black_24dp.svg",
        "scheme": "file"
    },
    null
]
parsed extension name: svg
find config by extensionName
found matched config
open with configItem:
{
    "extensionName": "svg",
    "apps": [
        {
            "title": "inkscape",
            "shellCommand": "/usr/bin/inkscape ${file}"
        }
    ]
}
opened file is: "/home/ruud/Documents/Company/app/frontend/src/assets/controller_black_24dp.svg"
variables:
    userHome: /home/ruud
    workspaceFolder: /home/ruud/Documents/Company/app/frontend
    workspaceFolderBasename: frontend
    file: /home/ruud/Documents/Company/app/frontend/src/assets/controller_black_24dp.svg
    fileWorkspaceFolder: /home/ruud/Documents/Company/app/frontend
    relativeFile: src/assets/controller_black_24dp.svg
    relativeFileDirname: src/assets
    fileBasename: controller_black_24dp.svg
    fileBasenameNoExtension: controller_black_24dp
    fileDirname: /home/ruud/Documents/Company/app/frontend/src/assets
    fileExtname: .svg
    cwd: /home/ruud/Documents/Company/app/frontend
    lineNumber: 1
    selectedText: 
    execPath: ${execPath}
    defaultBuildTask: ${defaultBuildTask}
    pathSeparator: /
    cursorLineNumber: 1
    cursorColumnNumber: 1
open file by shell command: "/usr/bin/inkscape /home/ruud/Documents/Company/app/frontend/src/assets/controller_black_24dp.svg"

Getting this error when changing icon theme, while this normally works

Error: Command failed: /usr/bin/inkscape /home/ruud/Documents/Company/app/frontend/src/assets/controller_black_24dp.svg

(org.inkscape.Inkscape:43540): Gtk-WARNING **: 11:10:55.146: Could not load a pixbuf from icon theme.
This may indicate that pixbuf loaders or the mime database could not be found.
**
Gtk:ERROR:../../../../gtk/gtkiconhelper.c:494:ensure_surface_for_gicon: assertion failed (error == NULL): Failed to load /usr/share/inkscape/icons/hicolor/scalable/actions/image-missing.svg: Unable to load image-loading module: /snap/code/117/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.so: /snap/core/current/lib/x86_64-linux-gnu/libpthread.so.0: undefined symbol: __libc_vfork, version GLIBC_PRIVATE (gdk-pixbuf-error-quark, 5)

Emergency save activated!
Emergency save completed. Inkscape will close now.
If you can reproduce this crash, please file a bug at https://inkscape.org/report
with a detailed description of the steps leading to the crash, so we can fix it.
**
Gtk:ERROR:../../../../gtk/gtkiconhelper.c:494:ensure_surface_for_gicon: assertion failed (error == NULL): Failed to load /usr/share/inkscape/icons/hicolor/scalable/actions/image-missing.svg: Unable to load image-loading module: /snap/code/117/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.so: /snap/core/current/lib/x86_64-linux-gnu/libpthread.so.0: undefined symbol: __libc_vfork, version GLIBC_PRIVATE (gdk-pixbuf-error-quark, 5)
Aborted (core dumped)