mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
builtin: use C.fwrite (buffered) for _write_buf_to_fd (#14558)
This commit is contained in:
@ -26,6 +26,7 @@ fn restore_terminal_state() {
|
||||
// clear the terminal and set the cursor to the origin
|
||||
print('\x1b[2J\x1b[3J')
|
||||
print('\x1b[?1049l')
|
||||
flush_stdout()
|
||||
}
|
||||
C.SetConsoleMode(ui.ctx_ptr.stdin_handle, ui.stdin_at_startup)
|
||||
}
|
||||
@ -65,6 +66,7 @@ pub fn init(cfg Config) &Context {
|
||||
print('\x1b[?1049h')
|
||||
// clear the terminal and set the cursor to the origin
|
||||
print('\x1b[2J\x1b[3J\x1b[1;1H')
|
||||
flush_stdout()
|
||||
}
|
||||
|
||||
if ctx.cfg.hide_cursor {
|
||||
@ -74,6 +76,7 @@ pub fn init(cfg Config) &Context {
|
||||
|
||||
if ctx.cfg.window_title != '' {
|
||||
print('\x1b]0;$ctx.cfg.window_title\x07')
|
||||
flush_stdout()
|
||||
}
|
||||
|
||||
unsafe {
|
||||
@ -317,10 +320,12 @@ fn (mut ctx Context) parse_events() {
|
||||
fn save_title() {
|
||||
// restore the previously saved terminal title
|
||||
print('\x1b[22;0t')
|
||||
flush_stdout()
|
||||
}
|
||||
|
||||
[inline]
|
||||
fn load_title() {
|
||||
// restore the previously saved terminal title
|
||||
print('\x1b[23;0t')
|
||||
flush_stdout()
|
||||
}
|
||||
|
Reference in New Issue
Block a user