mirror of
https://github.com/oven-sh/bun
synced 2026-02-14 21:01:52 +00:00
feat(hot-clear-screen): clear terminal on hot reload (#3976)
* feat(hot-clear-screen): clear terminal on hot reload * fix(hot-clear-screen): is now I n the correct place * fix(hot-clear-screen): enable buffering after terminal clear
This commit is contained in:
@@ -626,6 +626,13 @@ pub const VirtualMachine = struct {
|
||||
bun.reloadProcess(bun.default_allocator, !strings.eqlComptime(this.bundler.env.map.get("BUN_CONFIG_NO_CLEAR_TERMINAL_ON_RELOAD") orelse "0", "true"));
|
||||
}
|
||||
|
||||
if (!strings.eqlComptime(this.bundler.env.map.get("BUN_CONFIG_NO_CLEAR_TERMINAL_ON_RELOAD") orelse "0", "true")) {
|
||||
Output.flush();
|
||||
Output.disableBuffering();
|
||||
Output.resetTerminalAll();
|
||||
Output.enableBuffering();
|
||||
}
|
||||
|
||||
this.global.reload();
|
||||
this.pending_internal_promise = this.reloadEntryPoint(this.main) catch @panic("Failed to reload");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user