mirror of
https://github.com/vale981/tridactyl
synced 2025-03-06 01:51:40 -05:00
Added support for termite and terminator in editorcmd.
Tidied up the modification to editor().
This commit is contained in:
parent
d3334675c4
commit
778b541713
1 changed files with 9 additions and 3 deletions
|
@ -80,10 +80,12 @@ export async function getBestEditor(): Promise<string> {
|
||||||
"xterm -class tridactyl_editor -e",
|
"xterm -class tridactyl_editor -e",
|
||||||
"uxterm -class tridactyl_editor -e",
|
"uxterm -class tridactyl_editor -e",
|
||||||
"urxvt -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
|
"alacritty -e", // alacritty is nice but takes ages to start and doesn't support class
|
||||||
"cool-retro-term -e",
|
"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 --",
|
"dbus-launch gnome-terminal --",
|
||||||
// I wanted to put hyper.js here as a joke but you can't start it running a command,
|
// 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.
|
// 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"
|
config.get("editorcmd") == "auto"
|
||||||
? await getBestEditor()
|
? await getBestEditor()
|
||||||
: config.get("editorcmd")
|
: 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)
|
return await read(file)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue