=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/cmd-new-session.c,v retrieving revision 1.48 retrieving revision 1.49 diff -u -r1.48 -r1.49 --- src/usr.bin/tmux/cmd-new-session.c 2013/03/24 09:54:10 1.48 +++ src/usr.bin/tmux/cmd-new-session.c 2013/03/24 09:58:40 1.49 @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-new-session.c,v 1.48 2013/03/24 09:54:10 nicm Exp $ */ +/* $OpenBSD: cmd-new-session.c,v 1.49 2013/03/24 09:58:40 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -35,8 +35,8 @@ const struct cmd_entry cmd_new_session_entry = { "new-session", "new", - "dn:s:t:x:y:", 0, 1, - "[-d] [-n window-name] [-s session-name] " CMD_TARGET_SESSION_USAGE + "AdDn:s:t:x:y:", 0, 1, + "[-AdD] [-n window-name] [-s session-name] " CMD_TARGET_SESSION_USAGE " [-x width] [-y height] [command]", CMD_STARTSERVER|CMD_CANTNEST|CMD_SENDENVIRON, NULL, @@ -76,6 +76,10 @@ return (CMD_RETURN_ERROR); } if (session_find(newname) != NULL) { + if (args_has(args, 'A')) { + return (cmd_attach_session(cmdq, newname, + args_has(args, 'D'), 0)); + } cmdq_error(cmdq, "duplicate session: %s", newname); return (CMD_RETURN_ERROR); }