diff --git a/sway/commands/rename.c b/sway/commands/rename.c index 29f90d81c..491dbab0c 100644 --- a/sway/commands/rename.c +++ b/sway/commands/rename.c @@ -81,8 +81,12 @@ struct cmd_results *cmd_rename(int argc, char **argv) { struct sway_workspace *tmp_workspace = workspace_by_name(new_name); if (tmp_workspace) { free(new_name); - return cmd_results_new(CMD_INVALID, "rename", - "Workspace already exists"); + if (tmp_workspace == workspace) { + return cmd_results_new(CMD_SUCCESS, NULL, NULL); + } else { + return cmd_results_new(CMD_INVALID, "rename", + "Workspace already exists"); + } } wlr_log(WLR_DEBUG, "renaming workspace '%s' to '%s'", workspace->name, new_name);