aboutsummaryrefslogtreecommitdiff
path: root/sway/commands/rename.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/commands/rename.c')
-rw-r--r--sway/commands/rename.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sway/commands/rename.c b/sway/commands/rename.c
index d982f941..0cee9293 100644
--- a/sway/commands/rename.c
+++ b/sway/commands/rename.c
@@ -20,6 +20,10 @@ struct cmd_results *cmd_rename(int argc, char **argv) {
if ((error = checkarg(argc, "rename", EXPECTED_AT_LEAST, 3))) {
return error;
}
+ if (!root->outputs->length) {
+ return cmd_results_new(CMD_INVALID, "rename",
+ "Can't run this command while there's no outputs connected.");
+ }
if (strcasecmp(argv[0], "workspace") != 0) {
return cmd_results_new(CMD_INVALID, "rename", expected_syntax);
}