Enable inline URLs by default on VTE terminals

This commit is contained in:
Tulir Asokan
2022-04-16 19:59:34 +03:00
parent f1d720e2dc
commit b6fba5230a
7 changed files with 34 additions and 12 deletions

View File

@ -23,6 +23,7 @@ import (
"io/ioutil"
"os"
"path/filepath"
"strconv"
"strings"
"gopkg.in/yaml.v3"
@ -58,8 +59,21 @@ type UserPreferences struct {
DisableDownloads bool `yaml:"disable_downloads"`
DisableNotifications bool `yaml:"disable_notifications"`
DisableShowURLs bool `yaml:"disable_show_urls"`
InlineURLs bool `yaml:"inline_urls"`
AltEnterToSend bool `yaml:"alt_enter_to_send"`
InlineURLMode string `yaml:"inline_url_mode"`
}
var InlineURLsProbablySupported bool
func init() {
v, _ := strconv.Atoi(os.Getenv("VTE_VERSION"))
// Enable inline URLs by default on VTE 0.50.0+
InlineURLsProbablySupported = v > 5000
}
func (up *UserPreferences) EnableInlineURLs() bool {
return up.InlineURLMode == "enable" || (InlineURLsProbablySupported && up.InlineURLMode != "disable")
}
type Keybind struct {