Don't error if renaming a session to its current name, from shik dot

chen at gmail dot com.
This commit is contained in:
nicm 2016-11-16 11:41:17 +00:00
parent 81f1d625af
commit a8e2d851fe

View File

@ -19,6 +19,7 @@
#include <sys/types.h>
#include <stdlib.h>
#include <string.h>
#include "tmux.h"
@ -50,6 +51,9 @@ cmd_rename_session_exec(struct cmd *self, struct cmdq_item *item)
const char *newname;
newname = args->argv[0];
if (strcmp(newname, s->name) == 0)
return (CMD_RETURN_NORMAL);
if (!session_check_name(newname)) {
cmdq_error(item, "bad session name: %s", newname);
return (CMD_RETURN_ERROR);