diff --git a/src/native_background.ts b/src/native_background.ts index 90351f46..40b44401 100644 --- a/src/native_background.ts +++ b/src/native_background.ts @@ -80,10 +80,12 @@ export async function getBestEditor(): Promise { "xterm -class tridactyl_editor -e", "uxterm -class tridactyl_editor -e", "urxvt -e", - // "terminator -e", // NB: requires command to be in quotes, which breaks the others - // so terminator is not supported. "alacritty -e", // alacritty is nice but takes ages to start and doesn't support class "cool-retro-term -e", + // Terminator and termite require -e commands to be in quotes, hence the extra quote at the end. + // The closing quote is implemented in the editor function. + 'terminator -e "', + 'termite --class tridactyl_editor -e "', "dbus-launch gnome-terminal --", // I wanted to put hyper.js here as a joke but you can't start it running a command, // which is a far better joke: a terminal emulator that you can't send commands to. @@ -142,7 +144,11 @@ export async function editor(file: string, content?: string) { config.get("editorcmd") == "auto" ? await getBestEditor() : config.get("editorcmd") - await run(editorcmd + " " + file) + // Dirty hacks for termite and terminator support part 2. + const e = editorcmd.split(" ")[0] + if (e === "termite" || e === "terminator") { + await run(editorcmd + " " + file + '"') + } else await run(editorcmd + " " + file) return await read(file) }