summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Gläßer <tobimensch@users.noreply.github.com>2018-10-07 15:00:23 -0400
committerThomas Buckley-Houston <tom@tombh.co.uk>2019-06-24 09:09:58 +0300
commitdc9533969f9ce7bb55273ce834e0cb95fe5c61bd (patch)
tree4842aa2a9920909124729bde4208ed2d515f3dcf
parentca30b7722bbedc5b861b9ac9b7f4c8dd1ed38b24 (diff)
Set default DISPLAY environment variable for xclipboard functionality
-rw-r--r--interfacer/src/browsh/browsh.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/interfacer/src/browsh/browsh.go b/interfacer/src/browsh/browsh.go
index d3f2dc5..29f776b 100644
--- a/interfacer/src/browsh/browsh.go
+++ b/interfacer/src/browsh/browsh.go
@@ -181,6 +181,12 @@ func ttyEntry() {
// from tcell.
os.Setenv("TERM", "xterm-truecolor")
}
+ // This is for getting the clipboard (github.com/atotto/clipboard) to work
+ // with the applications xsel and xclip on systems with an X display server.
+ if os.Getenv("DISPLAY") == "" {
+ os.Setenv("DISPLAY", ":0")
+ }
+
realScreen, err := tcell.NewScreen()
if err != nil {
fmt.Fprintf(os.Stderr, "%v\n", err)