mirror of
https://github.com/tmate-io/tmate.git
synced 2025-01-11 16:38:47 +01:00
Handle empty pending output (not a failure) and add \n. From George Nachman.
This commit is contained in:
parent
f5de847a0c
commit
69d97f6d4b
@ -69,7 +69,7 @@ cmd_capture_pane_pending(struct args *args, struct window_pane *wp,
|
|||||||
line = EVBUFFER_DATA(wp->ictx.since_ground);
|
line = EVBUFFER_DATA(wp->ictx.since_ground);
|
||||||
linelen = EVBUFFER_LENGTH(wp->ictx.since_ground);
|
linelen = EVBUFFER_LENGTH(wp->ictx.since_ground);
|
||||||
|
|
||||||
buf = NULL;
|
buf = xstrdup("");
|
||||||
if (args_has(args, 'C')) {
|
if (args_has(args, 'C')) {
|
||||||
for (i = 0; i < linelen; i++) {
|
for (i = 0; i < linelen; i++) {
|
||||||
if (line[i] >= ' ') {
|
if (line[i] >= ' ') {
|
||||||
@ -189,6 +189,8 @@ cmd_capture_pane_exec(struct cmd *self, struct cmd_q *cmdq)
|
|||||||
return (CMD_RETURN_ERROR);
|
return (CMD_RETURN_ERROR);
|
||||||
}
|
}
|
||||||
evbuffer_add(c->stdout_data, buf, len);
|
evbuffer_add(c->stdout_data, buf, len);
|
||||||
|
if (args_has(args, 'P') && len > 0)
|
||||||
|
evbuffer_add(c->stdout_data, "\n", 1);
|
||||||
server_push_stdout(c);
|
server_push_stdout(c);
|
||||||
} else {
|
} else {
|
||||||
limit = options_get_number(&global_options, "buffer-limit");
|
limit = options_get_number(&global_options, "buffer-limit");
|
||||||
|
Loading…
Reference in New Issue
Block a user