Skip to content

An untitled note kept because something else wrote into it can't be reopened with Cmd+Shift+T #23771

Open

Description

@AmoabaKelvin

What happens

  1. Create a new untitled markdown note and don't type in it.
  2. Have an agent or another program write text into its untitled.md.
  3. Close the tab, then press Cmd+Shift+T.

Actual: the file stays on disk, but Cmd+Shift+T doesn't bring the tab back. Close All behaves the same way.
Expected: Cmd+Shift+T reopens the note like any other closed tab.

Found in review of #23768. It follows from the code; I haven't reproduced it in the app yet. Notes saved from Orca's own editor aren't affected: they're reopenable.

Why

  • When a tab closes, closeFile in src/renderer/src/store/slices/editor/actions/close-file-action.ts decides right away whether to add it to the reopen history. An untitled note that looks untouched (no unsaved text, never saved from the editor) is left out, because it's about to be deleted. closeAllFiles in recently-closed-editor-tabs.ts does the same.
  • fix(editor): keep saved untitled notes when their tab closes #23768 added a check in untitled-file-cleanup.ts that looks at the file on the machine that owns it and keeps it if it has content. That check finishes after the close, so the reopen history has already skipped the tab.
  • The reopen history is shared by terminal, browser and editor tabs, and its order decides which tab Cmd+Shift+T brings back.

Acceptance

  • Cmd+Shift+T reopens an untitled note that was kept because it had content, after both a normal close and Close All.
  • Cmd+Shift+T still reopens tabs in the right order when terminal, browser or other editor tabs were closed around it.
  • Covered for local and SSH/remote workspaces.
  • A test that fails if the fix is reverted.

Activity

  1. added
    bug
    on Sep 29, 2026
  2. 2SinceJuly commented on Nov 27, 2026

    @2SinceJuly
    Contributor

    Opened PR #51147, which fixes this together with #23772.

    The close decides the reopen history before the host answers, so an untouched note that turns out to have content was already skipped. The cleanup now asks the host to delete only if the pinned empty bytes are still there, and when the host reports the file was kept, the skipped tab goes back into the same reopen stack (rememberClosedEditorTabForReopen) in the same cross-type order as any other close — so Cmd+Shift+T and Close All reach it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugfile-editor

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions