mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
Cleanup code and optimize message
This commit is contained in:
@ -3878,27 +3878,27 @@ pub fn performBindingAction(self: *Surface, action: input.Binding.Action) !bool
|
|||||||
.copy_or_interrupt => {
|
.copy_or_interrupt => {
|
||||||
if (copyToClipboard(self)) {
|
if (copyToClipboard(self)) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
}
|
||||||
const buf = try self.alloc.alloc(u8, 1);
|
|
||||||
defer self.alloc.free(buf);
|
|
||||||
|
|
||||||
buf[0] = 3;
|
const SigInterrupt = 0x3;
|
||||||
|
|
||||||
self.io.queueMessage(try termio.Message.writeReq(
|
var data: termio.Message.WriteReq.Small.Array = undefined;
|
||||||
self.alloc,
|
data[0] = SigInterrupt;
|
||||||
buf,
|
|
||||||
), .unlocked);
|
|
||||||
|
|
||||||
// Text triggers a scroll.
|
self.io.queueMessage(.{
|
||||||
{
|
.write_small = .{
|
||||||
self.renderer_state.mutex.lock();
|
.data = data,
|
||||||
defer self.renderer_state.mutex.unlock();
|
.len = 1,
|
||||||
self.scrollToBottom() catch |err| {
|
},
|
||||||
log.warn("error scrolling to bottom err={}", .{err});
|
}, .unlocked);
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
// Text triggers a scroll.
|
||||||
|
{
|
||||||
|
self.renderer_state.mutex.lock();
|
||||||
|
defer self.renderer_state.mutex.unlock();
|
||||||
|
self.scrollToBottom() catch |err| {
|
||||||
|
log.warn("error scrolling to bottom err={}", .{err});
|
||||||
|
};
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user