mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-01-21 02:54:17 +08:00
parent
162053ed8d
commit
616d301083
|
@ -318,6 +318,14 @@ static int fish_parse_opt(int argc, char **argv, std::vector<std::string> *cmds)
|
||||||
/// Various things we need to initialize at run-time that don't really fit any of the other init
|
/// Various things we need to initialize at run-time that don't really fit any of the other init
|
||||||
/// routines.
|
/// routines.
|
||||||
static void misc_init() {
|
static void misc_init() {
|
||||||
|
// If stdout is open on a tty ensure stdio is unbuffered. That's because those functions might
|
||||||
|
// be intermixed with `write()` calls and we need to ensure the writes are not reordered. See
|
||||||
|
// issue #3748.
|
||||||
|
if (isatty(STDOUT_FILENO)) {
|
||||||
|
fflush(stdout);
|
||||||
|
setvbuf(stdout, NULL, _IONBF, 0);
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef OS_IS_CYGWIN
|
#ifdef OS_IS_CYGWIN
|
||||||
// MS Windows tty devices do not currently have either a read or write timestamp. Those
|
// MS Windows tty devices do not currently have either a read or write timestamp. Those
|
||||||
// respective fields of `struct stat` are always the current time. Which means we can't
|
// respective fields of `struct stat` are always the current time. Which means we can't
|
||||||
|
|
|
@ -689,9 +689,6 @@ void reader_write_title(const wcstring &cmd, bool reset_cursor_position) {
|
||||||
// Put the cursor back at the beginning of the line (issue #2453).
|
// Put the cursor back at the beginning of the line (issue #2453).
|
||||||
fputwc(L'\r', stdout);
|
fputwc(L'\r', stdout);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: This should be removed when issue #3748 is fixed.
|
|
||||||
fflush(stdout);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Reexecute the prompt command. The output is inserted into data->prompt_buff.
|
/// Reexecute the prompt command. The output is inserted into data->prompt_buff.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user