apprt: support a pwd change action

This commit is contained in:
Mitchell Hashimoto
2024-11-13 12:28:26 -08:00
parent 523e3a6ae3
commit 3ca246ceb9
7 changed files with 53 additions and 0 deletions

View File

@@ -1123,6 +1123,14 @@ pub const StreamHandler = struct {
log.debug("terminal pwd: {s}", .{path});
try self.terminal.setPwd(path);
// Report it to the surface. If creating our write request fails
// then we just ignore it.
if (apprt.surface.Message.WriteReq.init(self.alloc, path)) |req| {
self.surfaceMessageWriter(.{ .pwd_change = req });
} else |err| {
log.warn("error notifying surface of pwd change err={}", .{err});
}
// If we haven't seen a title, use our pwd as the title.
if (!self.seen_title) {
try self.changeWindowTitle(path);