From c71b49497d8fc8ee487b7cfeafb7392b71a13d17 Mon Sep 17 00:00:00 2001
From: Omnikar <omkar.subramaniam@icloud.com>
Date: Fri, 15 Oct 2021 21:04:26 -0400
Subject: [PATCH] Set CWD when editor is started with a directory (#849)

---
 helix-term/src/application.rs | 1 +
 1 file changed, 1 insertion(+)

diff --git a/helix-term/src/application.rs b/helix-term/src/application.rs
index 7667441b..b3fa79ee 100644
--- a/helix-term/src/application.rs
+++ b/helix-term/src/application.rs
@@ -100,6 +100,7 @@ impl Application {
         if !args.files.is_empty() {
             let first = &args.files[0]; // we know it's not empty
             if first.is_dir() {
+                std::env::set_current_dir(&first)?;
                 editor.new_file(Action::VerticalSplit);
                 compositor.push(Box::new(ui::file_picker(first.clone())));
             } else {