summaryrefslogtreecommitdiffstats
path: root/popup.c
diff options
context:
space:
mode:
authornicm <nicm>2021-08-13 19:55:11 +0000
committernicm <nicm>2021-08-13 19:55:11 +0000
commit7a0cec5ecf0d0a89caaee4a16b629155efe23f22 (patch)
treedcfb1c617162b06c14d2d4ec8600af085ad9929c /popup.c
parent2588c3e52e24a8726ac3d1277ede6ddf07dd6257 (diff)
Fill in some other bits on new panes.
Diffstat (limited to 'popup.c')
-rw-r--r--popup.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/popup.c b/popup.c
index f6867f91..1783411a 100644
--- a/popup.c
+++ b/popup.c
@@ -78,8 +78,8 @@ static const struct menu_item popup_menu_items[] = {
{ "Fill Space", 'F', NULL },
{ "Centre", 'C', NULL },
{ "", KEYC_NONE, NULL },
- { "Make Pane (H)", 'h', NULL },
- { "Make Pane (V)", 'v', NULL },
+ { "To Horizontal Pane", 'h', NULL },
+ { "To Vertical Pane", 'v', NULL },
{ NULL, KEYC_NONE, NULL }
};
@@ -299,6 +299,7 @@ popup_make_pane(struct popup_data *pd, enum layout_type type)
struct layout_cell *lc;
struct window_pane *wp = w->active, *new_wp;
u_int hlimit;
+ const char *shell;
window_unzoom(w);
@@ -307,16 +308,24 @@ popup_make_pane(struct popup_data *pd, enum layout_type type)
new_wp = window_add_pane(wp->window, NULL, hlimit, 0);
layout_assign_pane(lc, new_wp, 0);
- new_wp->fd = job_transfer(pd->job);
+ new_wp->fd = job_transfer(pd->job, &new_wp->pid, new_wp->tty,
+ sizeof new_wp->tty);
pd->job = NULL;
+ screen_set_title(&pd->s, new_wp->base.title);
screen_free(&new_wp->base);
memcpy(&new_wp->base, &pd->s, sizeof wp->base);
screen_resize(&new_wp->base, new_wp->sx, new_wp->sy, 1);
screen_init(&pd->s, 1, 1, 0);
+ shell = options_get_string(s->options, "default-shell");
+ if (!checkshell(shell))
+ shell = _PATH_BSHELL;
+ new_wp->shell = xstrdup(shell);
+
window_pane_set_event(new_wp);
window_set_active_pane(w, new_wp, 1);
+ new_wp->flags |= PANE_CHANGED;
pd->close = 1;
}