feat(file-manager): sync the working directory by default
The panel and the shell now share their directory out of the box; whoever wants the previous independence sets sync_cwd no. The request is only written once the shell has published its directory, since that file is what proves its integration hook will read the request: a shell without shell integration still gets the cd typed into the terminal instead of losing the change.
This commit is contained in:
7 files changed
+61
-16
No files matched your search
@@ -180,6 +180,19 @@ func TestOpenWithSudoOption(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestSyncCwdIsOnByDefault(t *testing.T) {
|
||||
c := NewConfig()
|
||||
if !c.Sync_cwd {
|
||||
t.Fatal("the panel must follow the shell by default")
|
||||
}
|
||||
if err := c.Parse("sync_cwd", "no"); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if c.Sync_cwd {
|
||||
t.Fatal("sync_cwd = no must keep the two directories independent")
|
||||
}
|
||||
}
|
||||
|
||||
func TestEditArgs(t *testing.T) {
|
||||
got := edit_args("/tmp/a.py")
|
||||
want := []string{"edit-in-kitty", "--type=tab", "/tmp/a.py"}
|
||||
|
||||
Reference in new issue
Block a user