terminal: restoreCursor is now longer fallible

We need to have sane behavior in error handling because the running
program that sends the restore cursor command has no way to realize it
failed. So if our style fails to add (our only fail case) then we revert
to no style.

https://ampcode.com/threads/T-019bd7dc-cf0b-7439-ad2f-218b3406277a
This commit is contained in:
Mitchell Hashimoto
2026-01-19 12:04:34 -08:00
parent c412b30cb5
commit a8b31ceb84
4 changed files with 103 additions and 36 deletions

View File

@@ -721,7 +721,7 @@ pub const StreamHandler = struct {
if (enabled) {
self.terminal.saveCursor();
} else {
try self.terminal.restoreCursor();
self.terminal.restoreCursor();
}
},
@@ -933,7 +933,7 @@ pub const StreamHandler = struct {
}
pub inline fn restoreCursor(self: *StreamHandler) !void {
try self.terminal.restoreCursor();
self.terminal.restoreCursor();
}
pub fn enquiry(self: *StreamHandler) !void {