summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2018-04-10 22:53:41 +0200
committerBoris Faure <billiob@gmail.com>2018-04-10 22:53:41 +0200
commit4a30c10ed9ce11d5221b70c82b4ae07b2c71d408 (patch)
tree637439edcddfb96b494e63888b87563b5b986777
parent9d2d4c6d833b7bab9a759c5ea1723b22bc48a036 (diff)
tabs: clicking on New uses current dir for new term according to configv1.2.0
-rw-r--r--src/bin/win.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/bin/win.c b/src/bin/win.c
index 0564865..c09680b 100644
--- a/src/bin/win.c
+++ b/src/bin/win.c
@@ -3255,7 +3255,7 @@ _tab_new_cb(void *data,
3255 Evas_Coord x, y, w, h; 3255 Evas_Coord x, y, w, h;
3256 Term_Container *tc = (Term_Container*) tabs, 3256 Term_Container *tc = (Term_Container*) tabs,
3257 *tc_new, *tc_parent, *tc_old; 3257 *tc_new, *tc_parent, *tc_old;
3258 Term *tm, *tm_new; 3258 Term *tm_new;
3259 Win *wn = tc->wn; 3259 Win *wn = tc->wn;
3260 char *wdir = NULL; 3260 char *wdir = NULL;
3261 char buf[PATH_MAX]; 3261 char buf[PATH_MAX];
@@ -3264,7 +3264,11 @@ _tab_new_cb(void *data,
3264 // passing wdir NULL otherwise: 3264 // passing wdir NULL otherwise:
3265 if (wn->config->changedir_to_current) 3265 if (wn->config->changedir_to_current)
3266 { 3266 {
3267 tm = tc->focused_term_get(tc); 3267 Term *tm;
3268
3269 tc_old = tabs->current->tc;
3270 tm = tc_old->term_first(tc_old);
3271
3268 if (tm && termio_cwd_get(tm->termio, buf, sizeof(buf))) 3272 if (tm && termio_cwd_get(tm->termio, buf, sizeof(buf)))
3269 wdir = buf; 3273 wdir = buf;
3270 } 3274 }