* modified files --- orig/ratpoison/src/actions.c +++ mod/ratpoison/src/actions.c @@ -1557,8 +1557,38 @@ cmd_echo (int interactive, char *data) { if (data) - marked_message_printf (0, 0, " %s ", data); - + { + int nr_newlines = 0; + char *buf; + int i, j; + + for (i=0; data[i]; i++) + if (data[i] == '\n') nr_newlines++; + + buf = xmalloc(strlen(data) + 2*(nr_newlines+1) + 1); + buf[0] = ' '; + + for (i=0, j=1; data[i]; i++) + { + if (data[i] == '\n') + { + buf[j] = ' '; + buf[j+1] = '\n'; + buf[j+2] = ' '; + j+=3; + } + else + { + buf[j] = data[i]; + j++; + } + } + buf[j] = ' '; + buf[j+1] = '\0'; + message (buf); + free(buf); + } + return NULL; }