Skip to content

Terminal opens in / when editing a single file #42945

@francescomalandrino

Description

@francescomalandrino

Summary

If I open zed in a directory, e.g., "zed ~/Desktop", then terminal panels open in that directory, as per the settings.

If I open an individual file in the directory, e.g., "zed hello.txt", then terminal panels open in the root directory /, which is (a) useless and (b) inconsistent with the behavior above.

I think a more sensible behavior would be that, when zed is used to open an individual file, it should consider that file's path as "the project directory", and open terminal panels there.

Description

Steps to reproduce (verified on MacOS, arm64, Zed 0.212.6):

  1. create a file, e.g., echo hello > ~/Desktop/hello.txt
  2. open that file in zed zed ~/Desktop/hello.txt
  3. open a terminal panel in zed

Expected Behavior:

The terminal opens in ~/Desktop

Actual Behavior:

The terminal opens in /

Zed Version and System Specs

Zed: v0.212.6 (Zed)
OS: macOS 26.1
Memory: 16 GiB
Architecture: aarch64

If applicable, attach your Zed.log file to this issue.

Zed.log

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions