Skip to content

Emacs Client doesn't work #95

@CobaltSpace

Description

@CobaltSpace

When I have emacsclient set to open a file, nothing happens.
testing with mimeopen from perl-file-mimeinfo works as expected.

I suspect this may have to do with character escaping in the Exec line

// handlr get text/org --json
{"cmd":"sh -c if [ -n \\\\$*\\ ]; then exec /usr/bin/emacsclient --alternate-editor= --reuse-frame \\\\$@\\; else exec emacsclient --alternate-editor= --create-frame; fi sh","handler":"emacsclient.desktop","name":"Emacs (Client)"}
// handlr get text/org --json | jq
{
  "cmd": "sh -c if [ -n \\\\$*\\ ]; then exec /usr/bin/emacsclient --alternate-editor= --reuse-frame \\\\$@\\; else exec emacsclient --alternate-editor= --create-frame; fi sh",
  "handler": "emacsclient.desktop",
  "name": "Emacs (Client)"
}
# /usr/share/applications/emacsclient.desktop
[Desktop Entry]
Name=Emacs (Client)
GenericName=Text Editor
Comment=Edit text
MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;x-scheme-handler/org-protocol;
Exec=sh -c "if [ -n \\"\\$*\\" ]; then exec /usr/bin/emacsclient --alternate-editor= --reuse-frame \\"\\$@\\"; else exec emacsclient --alternate-editor= --create-frame; fi" sh %F
Icon=emacs
Type=Application
Terminal=false
Categories=Development;TextEditor;
StartupNotify=true
StartupWMClass=Emacs
Keywords=emacsclient;
Actions=new-window;new-instance;

[Desktop Action new-window]
Name=New Window
Exec=/usr/bin/emacsclient --alternate-editor= --create-frame %F

[Desktop Action new-instance]
Name=New Instance
Exec=emacs %F

other applications work as expected

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions