Skip to content

Instantly share code, notes, and snippets.

@ThomasAdam
Last active December 19, 2015 05:59
Show Gist options
  • Select an option

  • Save ThomasAdam/5907706 to your computer and use it in GitHub Desktop.

Select an option

Save ThomasAdam/5907706 to your computer and use it in GitHub Desktop.
diff --git a/cmd-new-session.c b/cmd-new-session.c
index 4eebe63..5765aee 100644
--- a/cmd-new-session.c
+++ b/cmd-new-session.c
@@ -35,8 +35,9 @@ enum cmd_retval cmd_new_session_exec(struct cmd *, struct cmd_q *);
const struct cmd_entry cmd_new_session_entry = {
"new-session", "new",
- "AdDF:n:Ps:t:x:y:", 0, 1,
- "[-AdDP] [-F format] [-n window-name] [-s session-name] "
+ "Ac:dDF:n:Ps:t:x:y:", 0, 1,
+ "[-AdDP] [-F format] [-c start-directory] [-n window-name] "
+ "[-s session-name] "
CMD_TARGET_SESSION_USAGE " [-x width] [-y height] [command]",
CMD_STARTSERVER|CMD_CANTNEST|CMD_SENDENVIRON,
NULL,
@@ -140,6 +141,9 @@ cmd_new_session_exec(struct cmd *self, struct cmd_q *cmdq)
cwd = "/";
}
+ if (args_has(args, 'c'))
+ cwd = args_get(args, 'c');
+
/* Find new session size. */
if (c != NULL) {
sx = c->tty.sx;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment