Skip to content

Commit

Permalink
Revert r1.5, I don't like it, new sessions should start off identical…
Browse files Browse the repository at this point in the history
…ly - with

the defaults.
  • Loading branch information
nicm committed Jul 23, 2009
1 parent e0d1954 commit 8951714
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions cmd-new-session.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ cmd_new_session_exec(struct cmd *self, struct cmd_ctx *ctx)
{
struct cmd_new_session_data *data = self->data;
struct session *s;
struct options *oo;
char *cmd, *cwd, *cause;
int detached;
u_int sx, sy;
Expand Down Expand Up @@ -159,14 +158,6 @@ cmd_new_session_exec(struct cmd *self, struct cmd_ctx *ctx)
}
}

/*
* If the called from inside, use the source session for the default
* path and command.
*/
oo = &global_s_options;
if (ctx->cmdclient == NULL && ctx->curclient != NULL)
oo = &ctx->curclient->session->options;

/* Find new session size and options. */
if (detached) {
sx = 80;
Expand All @@ -180,7 +171,7 @@ cmd_new_session_exec(struct cmd *self, struct cmd_ctx *ctx)
sy = ctx->curclient->tty.sy;
}
}
if (sy > 0 && options_get_number(oo, "status"))
if (sy > 0 && options_get_number(&global_s_options, "status"))
sy--;
if (sx == 0)
sx = 1;
Expand All @@ -189,11 +180,11 @@ cmd_new_session_exec(struct cmd *self, struct cmd_ctx *ctx)
if (ctx->cmdclient != NULL && ctx->cmdclient->cwd != NULL)
cwd = ctx->cmdclient->cwd;
else
cwd = options_get_string(oo, "default-path");
cwd = options_get_string(&global_s_options, "default-path");
if (data->cmd != NULL)
cmd = data->cmd;
else
cmd = options_get_string(oo, "default-command");
cmd = options_get_string(&global_s_options, "default-command");

/* Create the new session. */
s = session_create(data->newname, cmd, cwd, sx, sy, &cause);
Expand Down

0 comments on commit 8951714

Please sign in to comment.