mirror of
https://github.com/vale981/tridactyl
synced 2025-03-06 01:51:40 -05:00
Merge pull request #501 from antonva/termite-terminator-support
Added support for termite and terminator in editorcmd.
This commit is contained in:
commit
6ed334967f
1 changed files with 9 additions and 3 deletions
|
@ -80,10 +80,12 @@ export async function getBestEditor(): Promise<string> {
|
|||
"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)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue