mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-28 05:43:11 +00: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
1 changed files with 4 additions and 1 deletions
|
@ -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…
Reference in a new issue