about summary refs log tree commit diff
path: root/nixpkgs-overlays/patches/tmux/0002-Load-tmux.conf-from-if-there-was-no-file-in-home-df0.patch
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs-overlays/patches/tmux/0002-Load-tmux.conf-from-if-there-was-no-file-in-home-df0.patch')
-rw-r--r--nixpkgs-overlays/patches/tmux/0002-Load-tmux.conf-from-if-there-was-no-file-in-home-df0.patch45
1 files changed, 45 insertions, 0 deletions
diff --git a/nixpkgs-overlays/patches/tmux/0002-Load-tmux.conf-from-if-there-was-no-file-in-home-df0.patch b/nixpkgs-overlays/patches/tmux/0002-Load-tmux.conf-from-if-there-was-no-file-in-home-df0.patch
new file mode 100644
index 000000000000..bd2c1c55a7b4
--- /dev/null
+++ b/nixpkgs-overlays/patches/tmux/0002-Load-tmux.conf-from-if-there-was-no-file-in-home-df0.patch
@@ -0,0 +1,45 @@
+From 0829e4239a63cbbe649e685d0c85abeccc16f7ab Mon Sep 17 00:00:00 2001
+From: fekir <federico.kircheis@gmail.com>
+Date: Tue, 31 Oct 2017 14:35:05 +0100
+Subject: [PATCH 2/2] Load tmux.conf from  if there was no file in /home/df0
+
+---
+ cfg.c | 14 ++++++++++++--
+ 1 file changed, 12 insertions(+), 2 deletions(-)
+
+diff --git a/cfg.c b/cfg.c
+index c29292b2..ac1b1218 100644
+--- a/cfg.c
++++ b/cfg.c
+@@ -69,7 +69,8 @@ set_cfg_file(const char *path)
+ void
+ start_cfg(void)
+ {
+-	const char	*home;
++	const char	*home = NULL;
++	const char	*config_dir;
+ 	int		 flags = 0;
+ 	struct client	*c;
+ 
+@@ -96,8 +97,17 @@ start_cfg(void)
+ 		xasprintf(&cfg_file, "%s/.tmux.conf", home);
+ 		flags = CMD_PARSE_QUIET;
+ 	}
+-	if (cfg_file != NULL)
++	if (cfg_file == NULL || load_cfg(cfg_file, c, NULL, flags, NULL) <= 0){
++		cfg_file = NULL;
++	}
++
++	if (cfg_file == NULL && (config_dir = find_config_dir(home)) != NULL) {
++		xasprintf(&cfg_file, "%s/tmux.conf", config_dir);
++		flags = CMD_PARSE_QUIET;
++	}
++	if (cfg_file != NULL){
+ 		load_cfg(cfg_file, c, NULL, flags, NULL);
++	}
+ 
+ 	cmdq_append(NULL, cmdq_get_callback(cfg_done, NULL));
+ }
+-- 
+2.23.0
+