aboutsummaryrefslogtreecommitdiff
path: root/window.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2009-08-13 19:03:59 +0000
committerNicholas Marriott <nicm@openbsd.org>2009-08-13 19:03:59 +0000
commit52793e7a3fc7f53b173ee887c221ff4ed38499e8 (patch)
tree356d4c56edbc1c2e4ed9d567c682dafc30290808 /window.c
parent2e3bb5a51193269305eca3d689b6c66d08b2530a (diff)
downloadrtmux-52793e7a3fc7f53b173ee887c221ff4ed38499e8.tar.gz
rtmux-52793e7a3fc7f53b173ee887c221ff4ed38499e8.tar.bz2
rtmux-52793e7a3fc7f53b173ee887c221ff4ed38499e8.zip
When creating a new session from the command-line where there is an external
terminal, copy the termios(4) special characters and use them for new windows created in the new session. Suggested by Theo.
Diffstat (limited to 'window.c')
-rw-r--r--window.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/window.c b/window.c
index cfef2b24..eccaa4e5 100644
--- a/window.c
+++ b/window.c
@@ -269,7 +269,8 @@ window_create1(u_int sx, u_int sy)
struct window *
window_create(const char *name, const char *cmd, const char *cwd,
- struct environ *env, u_int sx, u_int sy, u_int hlimit, char **cause)
+ struct environ *env, struct termios *tio, u_int sx, u_int sy, u_int hlimit,
+ char **cause)
{
struct window *w;
struct window_pane *wp;
@@ -277,7 +278,7 @@ window_create(const char *name, const char *cmd, const char *cwd,
w = window_create1(sx, sy);
wp = window_add_pane(w, hlimit);
layout_init(w);
- if (window_pane_spawn(wp, cmd, cwd, env, cause) != 0) {
+ if (window_pane_spawn(wp, cmd, cwd, env, tio, cause) != 0) {
window_destroy(w);
return (NULL);
}
@@ -470,8 +471,8 @@ window_pane_destroy(struct window_pane *wp)
}
int
-window_pane_spawn(struct window_pane *wp,
- const char *cmd, const char *cwd, struct environ *env, char **cause)
+window_pane_spawn(struct window_pane *wp, const char *cmd,
+ const char *cwd, struct environ *env, struct termios *tio, char **cause)
{
struct winsize ws;
int mode;
@@ -505,7 +506,7 @@ window_pane_spawn(struct window_pane *wp,
tv.tv_usec = NAME_INTERVAL * 1000L;
timeradd(&wp->window->name_timer, &tv, &wp->window->name_timer);
- switch (wp->pid = forkpty(&wp->fd, wp->tty, NULL, &ws)) {
+ switch (wp->pid = forkpty(&wp->fd, wp->tty, tio, &ws)) {
case -1:
wp->fd = -1;
xasprintf(cause, "%s: %s", cmd, strerror(errno));