-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: wezterm cwd compatibility (#439)
* add: new cwd utility * Use cwd::set_current_dir to update terminal with current working directory --------- Co-authored-by: kennycallado <kennycallado@hotmail.com>
- Loading branch information
1 parent
cab8214
commit 7aec4b6
Showing
6 changed files
with
28 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
use std::path; | ||
|
||
use crate::HOSTNAME; | ||
|
||
pub fn set_current_dir(path: &path::Path) -> std::io::Result<()> { | ||
std::env::set_current_dir(path)?; | ||
// OSC 7: | ||
// Escape sequences to advise the terminal of the working directory | ||
print!( | ||
"\x1b]7;file://{}{}\x1b\\", | ||
HOSTNAME.as_str(), | ||
path.display() | ||
); | ||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
pub mod cwd; | ||
pub mod format; | ||
pub mod fs; | ||
pub mod keyparse; | ||
|