aboutsummaryrefslogtreecommitdiff
path: root/i3-msg
diff options
context:
space:
mode:
authorOrestis Floros <orestisf1993@gmail.com>2018-03-18 03:38:06 +0200
committerOrestis Floros <orestisf1993@gmail.com>2018-03-18 03:38:06 +0200
commit124e64767ea7ce8fc46d53b9eb3ae7d7111dde30 (patch)
treeb92fcf6929640ed2307912d83d8f6c11b7a92817 /i3-msg
parent8f5c1cb6b851e4be8825ba70f12cdbcbb19f0e16 (diff)
downloadi3-124e64767ea7ce8fc46d53b9eb3ae7d7111dde30.tar.gz
i3-124e64767ea7ce8fc46d53b9eb3ae7d7111dde30.zip
i3-msg: only print input + errorposition if they exist
Before: $ i3-msg floating disable, move window to position 100 px 100 px ERROR: Your command: (null) ERROR: (null) ERROR: Cannot change position of a window/container because it is not floating. [{"success":true},{"success":false,"error":"Cannot change position of a window/container because it is not floating."}] After: $ i3-msg floating disable, move window to position 100 px 100 px ERROR: Cannot change position of a window/container because it is not floating. [{"success":true},{"success":false,"error":"Cannot change position of a window/container because it is not floating."}]
Diffstat (limited to 'i3-msg')
-rw-r--r--i3-msg/main.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/i3-msg/main.c b/i3-msg/main.c
index 91a714e5..96edb2c3 100644
--- a/i3-msg/main.c
+++ b/i3-msg/main.c
@@ -95,8 +95,10 @@ static int reply_start_map_cb(void *params) {
static int reply_end_map_cb(void *params) {
if (!last_reply.success) {
- fprintf(stderr, "ERROR: Your command: %s\n", last_reply.input);
- fprintf(stderr, "ERROR: %s\n", last_reply.errorposition);
+ if (last_reply.input) {
+ fprintf(stderr, "ERROR: Your command: %s\n", last_reply.input);
+ fprintf(stderr, "ERROR: %s\n", last_reply.errorposition);
+ }
fprintf(stderr, "ERROR: %s\n", last_reply.error);
}
return 1;