diff --git a/src/commands.c b/src/commands.c index 227c7fb1..2c709aef 100644 --- a/src/commands.c +++ b/src/commands.c @@ -1851,6 +1851,7 @@ void cmd_rename_workspace(I3_CMD, char *old_name, char *new_name) { !strcasecmp(child->name, old_name)); } else { workspace = con_get_workspace(focused); + old_name = workspace->name; } if (!workspace) { diff --git a/testcases/t/175-startup-notification.t b/testcases/t/175-startup-notification.t index 4ca41799..b27bed53 100644 --- a/testcases/t/175-startup-notification.t +++ b/testcases/t/175-startup-notification.t @@ -155,6 +155,11 @@ cmd "rename workspace temp to $first_ws"; is_num_children($first_ws, 3, 'three containers on the first workspace'); +# empty 'from' workspaces should not crash the renaming of startup sequences +cmd "workspace $first_ws"; +cmd "rename workspace to temp"; +cmd "rename workspace to $first_ws"; + # Switch to the first workspace and move the focused window to the # second workspace. cmd "workspace $first_ws";