asamuzaK / withExEditorHost

Native messaging host for withExEditor
MIT License
33 stars 8 forks source link

Redirect output of editorPath #84

Closed mb720 closed 4 years ago

mb720 commented 4 years ago

Using editorconfig.json I can start nvim in a new instance of my terminal emulator kitty:

{
  "editorPath": "/usr/bin/kitty",
  "cmdArgs": ["nvim", "${file}"]
}

This works somewhat but has the issue that kitty writes quite a bit of messages to stderr, something like "No render frame received in 0.25 seconds, re-requesting at ..."

This interferes with writing text with withExEditor since a window in Firefox pops up with that message.

I tried to redirect the messages of stderr to /dev/null like so:

{
  "editorPath": "/usr/bin/kitty",
  "cmdArgs": ["2>", "/dev/null", "nvim", "${file}"]
}

But now kitty wants to run the program 2> which doesn't exist. If I put the 2> /dev/null part at the end of cmdArgs, nvim edits the buffers 2> and /dev/null which is also not what I want.

Is there a way to redirect the stderr output of editorPath? Thanks!

asamuzaK commented 4 years ago

Why not turn off the Notify Host Error option in withExEditor?

I don't know much about shells, but what if ["2> /dev/null"] instead of ["2>", "/dev/null"]?

"cmdArgs": ["nvim", "${file}", "2> /dev/null"]

or

"cmdArgs": ["nvim", "${file}", "--", "2> /dev/null"]
mb720 commented 4 years ago

Thanks asamuzaK!

I turned off Notify Host Error since attempting to redirect in the cmdArgs didn't work: Neovim would always try to open the files 2> and /dev/null.