mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-06-01 01:21:22 +00:00
terminal: store title set by escape sequences
Add a title field to Terminal, mirroring the existing pwd field. The title is set via setTitle/getTitle and tracks the most recent value written by OSC 0/2 sequences. The stream handler now persists the title in terminal state in addition to forwarding it to the surface. The field is cleared on full reset.
This commit is contained in:
@@ -999,6 +999,12 @@ pub const StreamHandler = struct {
|
||||
return;
|
||||
}
|
||||
|
||||
// Set the title on the terminal state. We ignore any errors since
|
||||
// we can continue to operate just fine without it.
|
||||
self.terminal.setTitle(title) catch |err| {
|
||||
log.warn("error setting title in terminal state: {e}", .{err});
|
||||
};
|
||||
|
||||
@memcpy(buf[0..title.len], title);
|
||||
buf[title.len] = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user