mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-21 18:55:06 +08:00
Buffer in outputter_t::term_puts
We were calling write() once for each character; buffer these instead.
This commit is contained in:
parent
3d0200a115
commit
5f131878a9
@ -362,9 +362,12 @@ int outputter_t::term_puts(const char *str, int affcnt) {
|
||||
// scoped_push will restore it.
|
||||
scoped_lock locker{s_tputs_receiver_lock};
|
||||
scoped_push<outputter_t *> push(&s_tputs_receiver, this);
|
||||
s_tputs_receiver->begin_buffering();
|
||||
// On some systems, tputs takes a char*, on others a const char*.
|
||||
// Like tparm, we just cast it to unconst, that should work everywhere.
|
||||
return tputs(const_cast<char *>(str), affcnt, tputs_writer);
|
||||
int res = tputs(const_cast<char *>(str), affcnt, tputs_writer);
|
||||
s_tputs_receiver->end_buffering();
|
||||
return res;
|
||||
}
|
||||
|
||||
/// Write a wide character to the outputter. This should only be used when writing characters from
|
||||
|
Loading…
x
Reference in New Issue
Block a user