feat: update terminal working directory on project change
This commit is contained in:
parent
849ef606a7
commit
53310cc2dd
3 changed files with 10 additions and 2 deletions
|
@ -30,8 +30,8 @@
|
|||
.hash = "122019f077d09686b1ec47928ca2b4bf264422f3a27afc5b49dafb0129a4ceca0d01",
|
||||
},
|
||||
.vaxis = .{
|
||||
.url = "https://github.com/rockorager/libvaxis/archive/26072bd85e419e3c33b73f1cd29890b31a1933cc.tar.gz",
|
||||
.hash = "12209fb0db1467d24882f4a0fca367d25d7ef7353882270ba3b76382c185332c52ae",
|
||||
.url = "https://github.com/neurocyte/libvaxis/archive/f127e9e8a4dc8fa00e2d27806b1c506a3d0480b1.tar.gz",
|
||||
.hash = "1220276c7128ae663647a054c25ee6b8761fb346b3256f9b60ad03f9447d3d191221",
|
||||
},
|
||||
},
|
||||
.paths = .{
|
||||
|
|
|
@ -330,6 +330,10 @@ pub fn set_terminal_style(self: *Self, style_: Style) void {
|
|||
self.vx.state.changed_default_bg = false;
|
||||
}
|
||||
|
||||
pub fn set_terminal_working_directory(self: *Self, absolute_path: []const u8) void {
|
||||
self.vx.setTerminalWorkingDirectory(self.tty.anyWriter(), absolute_path) catch {};
|
||||
}
|
||||
|
||||
pub fn copy_to_system_clipboard(self: *Self, text: []const u8) void {
|
||||
var bufferedWriter = self.tty.bufferedWriter();
|
||||
self.vx.copyToSystemClipboard(bufferedWriter.writer().any(), text, self.a) catch |e| log.logger(log_name).err("copy_to_system_clipboard", e);
|
||||
|
|
|
@ -233,6 +233,8 @@ const cmds = struct {
|
|||
if (!try ctx.args.match(.{tp.extract(&project_dir)}))
|
||||
return;
|
||||
try project_manager.open(project_dir);
|
||||
const project = tp.env.get().str("project");
|
||||
tui.current().rdr.set_terminal_working_directory(project);
|
||||
_ = try self.statusbar.msg(.{ "PRJ", "open" });
|
||||
}
|
||||
|
||||
|
@ -253,6 +255,8 @@ const cmds = struct {
|
|||
if (self.file_list_type == .diagnostics and self.is_panel_view_showing(filelist_view))
|
||||
try self.toggle_panel_view(filelist_view, false);
|
||||
try project_manager.open(project_dir);
|
||||
const project = tp.env.get().str("project");
|
||||
tui.current().rdr.set_terminal_working_directory(project);
|
||||
_ = try self.statusbar.msg(.{ "PRJ", "open" });
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue