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-3735GitHub issuePublicReceived

Opening a new terminal with Super+Enter sometimes sets working directory to `/usr/bin` instead of $HOME

Reported by daviewales · filed Nov 16, 2025Closed upstream on 2025-11-17 by the merge of PR #3428 (closed by dhh). 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

Opening a new terminal with Super+Enter sometimes sets working directory to `/usr/bin` instead of $HOMErevision 1 · captured 2026-10-04 11:42 UTC via poll

System details

Thinkpad L380, Omarchy 3.1.7

What's wrong?

If the current active window has a child process, then Super+Enter sets the working directory of the newly opened terminal to the cwd of the child process. This is great when the current active window is a terminal, and the child process is a shell. This is less great when the current active window is Chromium or Firefox, and the child process is some random web process, with cwd /usr/bin.

Why

Looking at ~/.config/hypr/bindings.conf, we see the following:

bindd = SUPER, RETURN, Terminal, exec, $terminal --dir="$(omarchy-cmd-terminal-
cwd)"

Of particular interest, is the command omarchy-cmd-terminal-cwd.

We can reproduce the underlying issue by running the following, and ensuring that the active window is Chromium before the sleep finishes:

sleep 3 && omarchy-cmd-terminal-cwd

If you managed to focus Chromium before the sleep finished, you will see the output /usr/bin.

Looking at the source for omarchy-cmd-terminal-cwd, it is immediately clear why this happens:

https://github.com/basecamp/omarchy/blob/8350b84eee10601efce64efef6fe044f03bfcd32/bin/omarchy-cmd-terminal-cwd#L1-L17

You can see that it assumes that the current active window is a terminal, and that the last child PID belongs to a shell spawned by that terminal.

But this is not a valid assumption, if the current active window is not a terminal, and the last child PID of that window is not a shell.

Proposed fix

diff --git a/bin/omarchy-cmd-terminal-cwd b/bin/omarchy-cmd-terminal-cwd
index 062c35f..b651148 100755
--- a/bin/omarchy-cmd-terminal-cwd
+++ b/bin/omarchy-cmd-terminal-cwd
@@ -6,8 +6,10 @@ shell_pid=$(pgrep -P "$terminal_pid" | tail -n1)

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

-  if [[ -d $cwd ]]; then
+  # Check if $shell is a valid shell and $cwd is a directory.
+  if grep -qs "$shell" /etc/shells && [[ -d $cwd ]]; then
     echo "$cwd"
   else
     echo "$HOME"

I'll link a PR with this fix.

View raw text
### System details

Thinkpad L380, Omarchy 3.1.7

### What's wrong?

If the current active window has a child process, then Super+Enter sets the working directory of the newly opened terminal to the cwd of the child process. This is great when the current active window is a terminal, and the child process is a shell. This is less great when the current active window is Chromium or Firefox, and the child process is some random web process, with cwd `/usr/bin`.

## Why

Looking at `~/.config/hypr/bindings.conf`, we see the following:

``` conf
bindd = SUPER, RETURN, Terminal, exec, $terminal --dir="$(omarchy-cmd-terminal-
cwd)"
```

Of particular interest, is the command `omarchy-cmd-terminal-cwd`.

We can reproduce the underlying issue by running the following, and ensuring that the active window is Chromium before the sleep finishes:

``` bash
sleep 3 && omarchy-cmd-terminal-cwd
```

If you managed to focus Chromium before the sleep finished, you will see the output `/usr/bin`.

Looking at the source for `omarchy-cmd-terminal-cwd`, it is immediately clear why this happens:

https://github.com/basecamp/omarchy/blob/8350b84eee10601efce64efef6fe044f03bfcd32/bin/omarchy-cmd-terminal-cwd#L1-L17

You can see that it assumes that the current active window is a _terminal_, and that the last child PID belongs to a shell spawned by that terminal.

But this is not a valid assumption, if the current active window is _not_ a terminal, and the last child PID of that window is _not_ a shell.

## Proposed fix

``` diff
diff --git a/bin/omarchy-cmd-terminal-cwd b/bin/omarchy-cmd-terminal-cwd
index 062c35f..b651148 100755
--- a/bin/omarchy-cmd-terminal-cwd
+++ b/bin/omarchy-cmd-terminal-cwd
@@ -6,8 +6,10 @@ shell_pid=$(pgrep -P "$terminal_pid" | tail -n1)

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

-  if [[ -d $cwd ]]; then
+  # Check if $shell is a valid shell and $cwd is a directory.
+  if grep -qs "$shell" /etc/shells && [[ -d $cwd ]]; then
     echo "$cwd"
   else
     echo "$HOME"
```

I'll link a PR with this fix.

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.