I am using Sway/wlroots and I decided to switch to using terminal emacs for the forseeable future as there is no transparency in the xwayland version of emacs.
I previously bound emacs to run as a client to connect to my emacs daemon like so emacsclient -c -n -e '(switch-to-buffer nil)'
so that upon a sway keystroke it will open a new emacsframe/window.
Basically, how do I do this with emacsclient -nw
? my terminal of choice is termite
and so i tried to replace the above with this termite -e 'emacsclient -nw'
but emacs gets into a locked up state or doesnt launch at all.
Here's the error I get from invoking the previous command from another terminal:
me@laptop ~ % termite -e 'emacsclient -nw'
invalid color string: #
(termite:30425): GLib-WARNING **: 12:46:32.770: GChildWatchSource: Exit status of a child process was requested but ECHILD was received by waitpid(). See the documentation of g_child_watch_source_new() for possible causes.
I thought it may be something to do with the client/server config since launching a new emacs like this: termite -e 'emacs -nw'
works as expected, although still spits out the same error above.
&
at the end of the command to launch it asynchronously, and you might want to redirect stdout and stderr somewhere else to keep the terminal clean.termite -e 'emacsclient -nw'
works fine when run from a terminal, but fails when you bind it to a key in your Sway config? This works fine for me with i3 and gnome-terminal, so I suspect the problem is with termite or Sway, not Emacs. Can you try using other terminals - gnome-terminal or xterm etc?termite -e 'emacsclient -nw'
did not work,termite -e 'emacs -nw'
did. the former launched in a terminal or in sway/i3 produce the same result, a window is created but quickly disappears, with that warning.termite -e 'emacsclient -nw &'
but it only worked once and opened the buffer named &. looking back at the emacsclient args, it thinks&
is a file. so i added a.
liketermite -e 'emacsclient -nw . &'
and it seems to work as intended, except after opening several more emacsclient panes it saysFile no longer exists: /home/revive/&, write buffer to file?
So it must not be launching asynchronously like so either.