#7648·starship

BUG: Prompt disappears when path is a symlink to a subdirectory inside a Git repository

Author: ccqpeinCreated Aug 1, 2026Updated Aug 31, 2026
Labels🐛 bug

Bug Report

Current Behavior

When [directory] has repo_root_style enabled, visiting a directory that is a symlink pointing to a subdirectory inside a Git repo, the directory module outputs nothing (the current working directory vanishes from the prompt).

For example:

  • Logical Path: ~/projects/app-dir $\rightarrow$ symlinked to /Users/user/code/monorepo/packages/app-dir
  • Git root directory: /Users/user/code/monorepo
  • Result: Navigating to ~/projects/app-dir renders a blank directory prompt, and starship explain omits the directory module completely.

Expected Behavior

Starship should still render the current directory path (e.g. ~/projects/app-dir) instead of hiding the directory module.

Additional context/Screenshots

Possible Solution

In src/modules/directory.rs (around line 115):

let contracted_path = contract_repo_path(display_dir, repo_root)?;

The ? operator causes pub fn module() to return None immediately whenever contract_repo_path returns None.

Replacing ? with a fallback safely handles None without dropping the whole module

Environment

  • Starship version: 1.26.0
  • Shell type: fish
  • Shell version: fish 4.7.1
  • Shell plugin manager: none
  • Operating system: macOS

Relevant Shell Configuration

Starship Configuration

# ~/.config/starship.toml
[directory]
repo_root_style = "bold red"