summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/popup.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2021-08-13 19:55:12 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2021-08-13 19:55:12 +0000
commitb8fa4b5134a93cf2d362a0475e772da7c52c6068 (patch)
tree642c15a196f0169f90f8ed2ab315d282c11cdb3d /usr.bin/tmux/popup.c
parent995a8bb393913f9a1f4eb773b70aad7a622b614c (diff)
Fill in some other bits on new panes.
Diffstat (limited to 'usr.bin/tmux/popup.c')
-rw-r--r--usr.bin/tmux/popup.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/usr.bin/tmux/popup.c b/usr.bin/tmux/popup.c
index dfe486694eb..56e7c46d965 100644
--- a/usr.bin/tmux/popup.c
+++ b/usr.bin/tmux/popup.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: popup.c,v 1.29 2021/08/13 19:27:25 nicm Exp $ */
+/* $OpenBSD: popup.c,v 1.30 2021/08/13 19:55:11 nicm Exp $ */
/*
* Copyright (c) 2020 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -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;
}