@@ -1386,6 +1386,15 @@ mod cmd {
1389+ fn show_current_directory(editor: &mut Editor, args: &[&str], _: PromptEvent) {
1390+ match std::env::current_dir() {
1391+ Ok(cwd) => editor.set_status(format!("Current working directory is {}", cwd.display())),
1393+ editor.set_error(format!("Couldn't get the current working directory: {}", e))
1389 pub const TYPABLE_COMMAND_LIST: &[TypableCommand] = &[
1398 pub const TYPABLE_COMMAND_LIST: &[TypableCommand] = &[
1390 TypableCommand {
1399 TypableCommand {
1391 name: "quit",
1400 name: "quit",
@@ -1562,6 +1571,13 @@ mod cmd {
1562 fun: change_current_directory,
1571 fun: change_current_directory,
1563 completer: Some(completers::directory),
1572 completer: Some(completers::directory),
1575+ name: "show-directory",
1576+ alias: Some("pwd"),
1577+ doc: "Show the current working directory.",
1578+ fun: show_current_directory,
1567 pub static COMMANDS: Lazy<HashMap<&'static str, &'static TypableCommand>> = Lazy::new(|| {
1583 pub static COMMANDS: Lazy<HashMap<&'static str, &'static TypableCommand>> = Lazy::new(|| {