History

msg: strip control char also when not printing to terminal

Kacper Michajłow committed 2 years ago

Commit 39d35911 parent 65c81c31 file · +2 −1Browse files

Unified · Split

common/msg.c+2−1
@@ -521,10 +521,11 @@ static void write_term_msg(struct mp_log *log, int lev, bstr text, bstr *out) · 520 unmodified lines
521 break;521 break;
522 }522 }
523 523
524 bool clip = bstr_eatstart0(&line, TERM_MSG_0);
524 if (print_term) {525 if (print_term) {
525 int line_w;526 int line_w;
526 append_terminal_line(log, lev, line, &root->term_msg_tmp, &line_w,527 append_terminal_line(log, lev, line, &root->term_msg_tmp, &line_w,
527 bstr_eatstart0(&line, TERM_MSG_0) ? term_w : INT_MAX);528 clip ? term_w : INT_MAX);
528 term_msg_lines += (!line_w || !term_w)529 term_msg_lines += (!line_w || !term_w)
529 ? 1 : (line_w + term_w - 1) / term_w;530 ? 1 : (line_w + term_w - 1) / term_w;
530 }531 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t