Proof Portal

Project overview

Omarchy

ProbeLabs65 findings · 95 requirements

A proof layer — requirements, tests and verified fixes — for two of Omarchy's subsystems: the application menu (launcher scripts, QML model, JSONC config, search and selection) and the lock screen (lock scripts, QML, PAM authentication). Scope is deliberately limited to those components of omacom/omarchy; the rest of the distribution is not covered.

Inbox
ReportR-4796GitHub issuePublicReceived

omarchy-cmd-terminal-cwd resolves the wrong directory with Ghostty, the default terminal

Reported by kurtome · filed Aug 31, 2026Closed upstream on 2026-09-21 by bjarneo via an automated message, as a duplicate of #3963 (R-2035). GitHub close reason: completed.

Received and recorded verbatim. Nothing has been checked yet.

At a glance

1 · What is claimed?
Only the report text below — no validator has restated it as checkable claims yet.
2 · What does it affect?
Not yet mapped to any requirement or component.
3 · Is it reproducible?
No validation has been run yet.
4 · What remains unclear?
  • Not validated yet: no claims, no reproducer.
5 · What happens next?
Our staff decide whether the report is valid. Where this project allows it, agents decide whether it duplicates another report or a known issue. No decision has been recorded yet.

Original report

omarchy-cmd-terminal-cwd resolves the wrong directory with Ghostty, the default terminalrevision 1 · captured 2026-10-04 12:03 UTC via poll

What happened

SUPER + RETURN (omarchy-launch-terminal) is documented as opening a terminal in the active terminal's current directory. With Ghostty — Omarchy's default terminal — it instead opens in whichever directory the most recently spawned shell happens to be in, regardless of which window is focused.

In practice every new terminal opened in the same unrelated project directory for me, no matter which Ghostty window I pressed the binding from.

Expected

New terminal opens in the focused terminal's working directory.

Root cause

omarchy-cmd-terminal-cwd resolves the shell by walking the children of the focused window's pid:

terminal_pid=$(hyprctl activewindow | awk '/pid:/ {print $2}')
...
  shell_pid=$(pgrep -P "$terminal_pid" | tail -n1)

  if [[ -n $shell_pid ]]; then
    cwd=$(readlink -f "/proc/$shell_pid/cwd" 2>/dev/null)

That assumes one process per terminal window. Ghostty's packaged desktop entry hardcodes single-instance mode:

$ grep Exec= /usr/share/applications/com.mitchellh.ghostty.desktop
Exec=/usr/bin/ghostty --gtk-single-instance=true

So every Ghostty window is hosted by a single process. hyprctl activewindow returns that same pid for all of them, and pgrep -P … | tail -n1 picks the newest child shell, which has nothing to do with focus:

$ hyprctl clients | grep -E "class: com.mitchellh.ghostty" -B2 | grep pid:
        pid: 5081
        pid: 5081
        pid: 5081

$ for p in $(pgrep -P 5081); do echo "$p  $(readlink /proc/$p/cwd)"; done
5163     /home/user/src/alpha/app
12740    /home/user/src/alpha
481411   /home/user/src/alpha/server
573292   /home/user/src/alpha
1127008  /home/user/src/beta        <- tail -n1 picks this one

(paths genericized; nothing else changed)

The script already handles this correctly for kitty, querying its control socket for the genuinely focused window:

if [[ -S $kitty_socket ]]; then
  cwd=$(kitten @ --to "unix:$kitty_socket" ls --match "state:focused" ...

Ghostty has no equivalent branch, so it always falls through to the pid-walking path that single-instance mode breaks.

Reproduction

  1. Default Omarchy setup (~/.config/xdg-terminals.list → com.mitchellh.ghostty.desktop).
  2. Open two Ghostty windows and cd them to different directories.
  3. Focus the first window, press SUPER + RETURN.
  4. The new terminal opens in the second window's directory.

omarchy-cmd-terminal-cwd can be run directly to see the resolved path without opening a window.

Notes

Ghostty exposes no kitty-style control socket, so the fix is not a drop-in mirror of the kitty branch. Options might be reading the focused window's title (Ghostty sets it to the cwd via shell integration, but only when sitting at a prompt), or not passing --gtk-single-instance=true in the desktop entry Omarchy ships.

Happy to test any approach on this machine.

System

  • Omarchy 4.0.0-1
  • Ghostty 1.3.1-2
  • Hyprland 0.56.2-1
View raw text
## What happened

`SUPER + RETURN` (`omarchy-launch-terminal`) is documented as opening a terminal in the active terminal's current directory. With Ghostty — Omarchy's default terminal — it instead opens in whichever directory the *most recently spawned* shell happens to be in, regardless of which window is focused.

In practice every new terminal opened in the same unrelated project directory for me, no matter which Ghostty window I pressed the binding from.

## Expected

New terminal opens in the focused terminal's working directory.

## Root cause

`omarchy-cmd-terminal-cwd` resolves the shell by walking the children of the focused window's pid:

```bash
terminal_pid=$(hyprctl activewindow | awk '/pid:/ {print $2}')
...
  shell_pid=$(pgrep -P "$terminal_pid" | tail -n1)

  if [[ -n $shell_pid ]]; then
    cwd=$(readlink -f "/proc/$shell_pid/cwd" 2>/dev/null)
```

That assumes one process per terminal window. Ghostty's packaged desktop entry hardcodes single-instance mode:

```
$ grep Exec= /usr/share/applications/com.mitchellh.ghostty.desktop
Exec=/usr/bin/ghostty --gtk-single-instance=true
```

So every Ghostty window is hosted by a single process. `hyprctl activewindow` returns that same pid for all of them, and `pgrep -P … | tail -n1` picks the newest child shell, which has nothing to do with focus:

```
$ hyprctl clients | grep -E "class: com.mitchellh.ghostty" -B2 | grep pid:
        pid: 5081
        pid: 5081
        pid: 5081

$ for p in $(pgrep -P 5081); do echo "$p  $(readlink /proc/$p/cwd)"; done
5163     /home/user/src/alpha/app
12740    /home/user/src/alpha
481411   /home/user/src/alpha/server
573292   /home/user/src/alpha
1127008  /home/user/src/beta        <- tail -n1 picks this one
```

(paths genericized; nothing else changed)

The script already handles this correctly for kitty, querying its control socket for the genuinely focused window:

```bash
if [[ -S $kitty_socket ]]; then
  cwd=$(kitten @ --to "unix:$kitty_socket" ls --match "state:focused" ...
```

Ghostty has no equivalent branch, so it always falls through to the pid-walking path that single-instance mode breaks.

## Reproduction

1. Default Omarchy setup (`~/.config/xdg-terminals.list` → `com.mitchellh.ghostty.desktop`).
2. Open two Ghostty windows and `cd` them to different directories.
3. Focus the **first** window, press `SUPER + RETURN`.
4. The new terminal opens in the **second** window's directory.

`omarchy-cmd-terminal-cwd` can be run directly to see the resolved path without opening a window.

## Notes

Ghostty exposes no kitty-style control socket, so the fix is not a drop-in mirror of the kitty branch. Options might be reading the focused window's title (Ghostty sets it to the cwd via shell integration, but only when sitting at a prompt), or not passing `--gtk-single-instance=true` in the desktop entry Omarchy ships.

Happy to test any approach on this machine.

## System

- Omarchy `4.0.0-1`
- Ghostty `1.3.1-2`
- Hyprland `0.56.2-1`

Validation

Not checked yet. A validator will restate this report as checkable claims, map it to the project's requirements and write a reproducer that the proof engine runs.

Linked

Not linked to any known issue, other report or change yet.

Decision

Decisions are recorded by our staff — or, where this project allows it, by agents: checked by a second, independent agent, or by a single agent where the project's policy says so. Any decision reached so far is shown below.

No decision has been recorded yet.