While in Preview Mode - Ctrl+O doesnt work on windows
Describe the bug When I'm on preview mode, if I press ctrl+O to open a file it doesn't work, it seems to work normally in edit mode.
Expected behavior It should work either in edit or preview mode
Screenshots
Device
- OS: Windows
- Version: 11
- App Version 2.6.10
PS: I opened the scroll poisition issue which is supposed to be fixed on this version (2.6.10) but it doesn't keep scroll position while in preview mode as well, I don't wanna open another just for this, hope you see this as well :)
PPS: I had a problem when I try to save a new file markpad hard closes and don't even save the file in memory/temp (I have to rewrite). Will try to understand how it happens and post a new issue
The current viewer-level shortcut handler now processes Ctrl/Cmd+O outside Monaco, including pure preview mode; scripts/reloadOpenToolbar.test.ts covers that path. Could you retest with v2.6.14 or a build from current master? If the file dialog opens from preview, this issue can be closed as fixed.
Fixed in v2.6.12. In v2.6.11 there was no Ctrl+O handler at all outside the editor; it's now handled at the document level, so it works in reading, editor and split mode alike.
The two items in your PS are separate and not covered by that change — the preview scroll position on reopen, and the crash when saving a new file. If either still reproduces on a current build, please open them individually so they don't get lost.
This should be working, though it landed earlier than you would expect — in v2.6.12, not v2.7.0. Ctrl/Cmd+O is now handled at the document level rather than inside Monaco and has no edit-mode guard, so it fires in reading, editor and split view alike.
I should correct myself on one point: I earlier cited a test covering this path, and that test does not exist. Nothing currently guards it, so your confirmation is the only check there is.
Your PS and PPS are separate and still open — the preview scroll position on reopen may be covered by #420 in v2.7.0, but the crash when saving a new file was never reproduced. If either still happens, please open them individually so they don't get lost in this thread.
Thanks! I'll let you know as soon as I test. Up to you if you wanna keep this open or not
EDIT: the preview scroll position is working only on clear markers, I have 2 files open: 1 with headings, subheadings etc. the other with only text, the 2nd one always go back to the top when I scroll another file. I'd say it's partially fixed and it's better than before, for sure.
Thanks for the edit — that detail turned out to be the whole thing, and you were right to call it partially fixed.
The cause is a <br>. Markdown is rendered with hardbreaks on, so every soft-wrapped line inside a paragraph ends in a <br> that carries a source position like any other element. When the scroll restore looks for "the block that owns the line I was on", it finds that <br> — and a <br> has no box, so its position reads as 0 and the preview jumps to the top. Measured on 2.7.0: 32 of 40 restores in wrapped prose landed at the top, the worst by 4378 px.
So the variable is not headings, it is how the file is wrapped. Headings dilute it, because a heading or a list item is a single-line block that does have a box — but a document with headings and wrapped paragraphs still failed half the time in the same test. Which makes me fairly sure your two files differ in wrapping: the one that works is probably written one long line per paragraph, and the "only text" one is hard-wrapped. Could you confirm that? If so this is fully explained.
Fix is in #464 — the resolver now skips elements that generate no box and falls back to the enclosing paragraph, which is what the interpolation was built for. Worst drift after the fix: 15 px.
Ctrl+O and your PPS are unchanged from my earlier comment.
Ctrl+O seems to be working fine now. I had an issue which is minor: I think the latest file I opened in markpad was in WSL (not windows file system) which caused it to freeze the app for like 30-60 seconds, since it was probably looking for a file in the latest folder. Once I tried again, it was normal. I don't know how "fixable" this is, but it's worth noting.
Regarding the scroll position, I can't fully test right now but I see that you opened and merged a PR, I can come back to it later to test.
The PPS: once it happens again I'll comment here, still not sure what caused it.
Good — Ctrl+O confirmed, thanks. #464 is merged, so the scroll position is worth retesting whenever you get to it; the case to try is the hard-wrapped file, since that is the one the fix targets.
The WSL freeze is worth pinning down, and one detail decides where it lives. Did it freeze on launch, or at the moment you pressed Ctrl+O?
- On launch — that is session restore reading the WSL file back, which is our code and fixable.
- When the dialog opened — that is the Windows file picker resolving the folder it remembers on its own. Markpad doesn't set a starting folder, so the dialog restores its own last location, and
\\wsl$\…can take a long time to resolve when the distro isn't running. Less ours, though we could pass an explicit starting folder to avoid it.
Also useful: was the WSL file still open as a tab when you relaunched, or only in the recent list? I checked, and the recent list doesn't touch the filesystem to render, so if it was only there, neither explanation fits and I'd want to look harder.
Either way it is a real complaint — a blocking filesystem call on an unreachable path is exactly the shape that should never reach the UI thread. Happy to take it as its own issue once we know which of the two it is.
Ok, I just updated to 2.7.1: Scroll position seems fixed! Ctrl+O in the HOME panel is not working (I didn't test in the previous version)
WSL file: Markpad opens in the home screen with no files in tabs when WSL is not running. It's hard to reproduce it, but as I'm testing, I can't see any of my previous files tabs anymore, it only showed once and WSL was running. I have 1 or more files in my "session" that are from WSL maybe the restore session is silently crashing? When I run WSL and open markpad, it does not restore the state. When WSL is not running and I try to open a file with a WSL folder being the latest known folder: Windows start WSL and open the folder, that's what's causing the freeze, I think.
EDIT: Ok I found something weird going on here as well: I have 2 Markpad Installed and 1 of them does not update to 2.7.1 even with the auto updater ( AppData\Local\Markpad ) I have no idea why there are 2, maybe the auto updater hardcoded a path to update files here? The one that I Installed manually is on the latest version. Neither has my previous session files open
Good — scroll position confirmed on 2.7.1, thanks for going back and testing it.
First, a correction I owe you. On 2026-08-05 I retracted my earlier claim that a test covered the Ctrl+O path, because the file I named did not exist. That was true at the time — it had been deleted in #433, and it had never been a real test anyway, just a regex looking for the words key === 'o' in the source. It is now covered for real: #488/#493 added a shortcut registry and a harness that fires a synthetic Ctrl+O at the actual handler and asserts it reaches the open-file call, and that shipped in the 2.7.1 you are running. So: no test, then a test, and I got there by contradicting myself twice. Sorry for the noise.
Which brings me to the awkward part — that test passes, and I cannot find anything in the code that would make Ctrl+O behave differently on the home screen. The handler is on the document, not on the editor, and none of its guards mentions the home screen. So either something is intercepting the key before it arrives, or the dialog is opening and you are not seeing it. Three questions, cheapest first:
1. On the home screen, does Ctrl+T (new file) work? Same handler, three lines earlier in the same function, and it opens no dialog. If Ctrl+T also does nothing, the whole handler is not running and the problem is upstream of Ctrl+O. If Ctrl+T works, the handler is fine and the problem is inside the file dialog.
2. When Ctrl+O appears to do nothing — does Windows grey the title bar and add "(Not Responding)"? This matters because of what you already told us: that the picker reopens the last folder, and that a \\wsl$\… folder with the distro stopped is what causes the stall. The picker runs on its own thread, so if that is what is happening, the window should stay drawn and simply ignore clicks, with the dialog eventually appearing — no "(Not Responding)". If you see "(Not Responding)", or no dialog even after a couple of minutes, it is something else and I want to know.
3. Start the WSL distro first, then press Ctrl+O on the home screen — does it open immediately? Same code, same screen, only the reachability of the remembered folder changes.
If it turns out to be the picker's remembered folder, that is a real complaint and I am not going to close it as "Windows behaviour" — Markpad passes no starting folder, so the shell falls back to its own last-visited one. The fix is not simply to pass one, because the obvious value is the last-used directory, which in your case is the unreachable path. It needs a reachability check that cannot itself block the window.
On the missing tabs — one question decides it: how do you quit Markpad? The ✕ in the corner, Ctrl+Q on the keyboard, or the Exit item in the ☰ menu?
They are not the same. Exit deletes the saved session on purpose (that is how it differs from closing a window), while ✕ and the Ctrl+Q keystroke save it. And there is a worse interaction that #464 and your WSL report together made visible: while the app is starting up and restoring your files, keyboard shortcuts are inert and the loading screen still shows the ☰ menu — so if a restore stalls on an unreachable path, the one control that responds is the one that erases the session it is restoring. That would produce exactly what you describe: no tabs, hard to reproduce, and only around the time WSL was down.
#503 gates that: during startup, Exit now falls through to the same plain close ✕ performs, so the session is written back rather than deleted. Whether Exit should erase the session at all is a separate question I have not answered yet.
Also worth knowing, since it explains the second half of your edit: both of your installs share one session file (%APPDATA%\com.alecdotdev.markpad\), which is keyed to the app, not to where it is installed. So the two copies are not the reason neither had your tabs.
On the two installs — could you check whether uninstall.exe sits next to Markpad.exe in AppData\Local\Markpad?
Up to 2.6.14 we shipped a second installer of our own, MarkpadInstaller_<version>_x64.exe, alongside the normal setup. Its default target was exactly %LOCALAPPDATA%\Markpad, and it registered itself in a way the normal installer has no way to discover — so the normal installer cannot find that copy to upgrade it, and installs a fresh one elsewhere. It was removed in 2.7.0/2.7.1 (#355, #481), but the copies it left behind are still out there. No uninstall.exe beside the binary is a strong sign that copy came from it.
One more thing that would explain it on its own: Markpad only checks for updates when you ask it to — there is no check at startup. A copy you never launch never checks, so it stays where it is regardless.
Neither of those is your fault, and "I have no idea why there are 2" is a fair reaction. I'd rather move it to its own issue once we know which of the two it is, so it does not get lost in this thread.
You can disregard the Ctrl+O issue on the home screen. I was unknowingly using the older of the two Markpad installations.
Here are the remaining test results:
- Ctrl+O with WSL stopped: Markpad freezes completely. I cannot click, minimize, or interact with the window. It eventually shows “Not Responding” when Windows is unable to start or reach WSL.
- Ctrl+O with WSL running: The file picker opens immediately.
Regarding the missing tabs/session, I normally close Markpad using the window’s ✕ button, not the Exit menu item.
Unfortunately, while removing the duplicate installation from %LOCALAPPDATA%\Markpad, I accidentally also deleted the com.alecdotdev.markpad folder. I therefore cannot reproduce or investigate the missing-tabs issue further. Hopefully there were no important unsaved files in that session.
I also cannot confirm whether uninstall.exe was next to Markpad.exe, since I deleted the installation folder manually before checking.
Thank you — those three tests answered more than they look like they did, including one thing I had predicted wrongly.
I was wrong about the freeze. I told you the picker runs on its own thread and therefore predicted you would not see "Not Responding". You saw it. That single observation moves this from "the shell is busy on its own thread, less ours" to "our main thread is stuck", which is ours to fix.
What I had missed is which threads are in which COM apartment. Our main thread calls OleInitialize, so it is a single-threaded apartment; the thread the file picker runs on enters one too. Calls between two apartments are not made directly — they are posted to the target thread and run by its message loop. So while the picker is resolving \\wsl$\… and Windows is trying to start the distro, anything on that path that needs an object living in our main thread's apartment parks the main thread inside that call. It stops pumping messages, Windows paints "(Not Responding)", and clicks and minimise stop working — exactly what you described.
I cannot point at the individual call that does it without a debugger on Windows, and I do not have one. But the fix does not depend on knowing: Markpad passes no starting folder to the picker, so the shell falls back to the folder it remembers per executable, which is your WSL path. Passing a starting folder we have already checked is reachable — on a thread that is not the main one — means the shell never resolves that path at all. That is the change worth making.
The missing tabs are explained, and it is better news than it looks.
Your own Ctrl+O result dates the old copy for us: the home-screen Ctrl+O handler landed in 2.6.12, and that copy did not have it, so it predates 2.6.12. The session snapshot moved out of the webview's local storage and into a file of its own in 2.6.14. A copy older than 2.6.12 therefore looks for your session in its own local storage — and the two installs do not share one, because each gets its own WebView2 profile (that is the documented default when an app names no data folder, which we do not).
So the old copy was reading a store that never had your documents in it. Home screen, no tabs, every time — no bug, no lost session, nothing to do with WSL. The one time it did restore was the newer copy. That also means the Exit-versus-✕ difference I asked about was not what happened to you; you told me you use ✕, and ✕ has always been the one that saves.
On the folder you deleted: no document content was ever in it. The snapshot records which files were open, the active tab, and per-tab view state — never file contents. Unsaved edits are resolved when a tab closes, not stored there, so nothing you had typed could have been sitting in that folder waiting to be lost. What it did hold was the list of open files, pinned tags, the theme setting, and any custom themes. Worth knowing, but none of it is your work.
One root cause under two of the three things you reported. The duplicate install is why the home-screen Ctrl+O looked broken (you were testing a build from before that feature existed) and why your tabs never came back (a different session store). It also means every symptom you reported carried an unanswerable "which binary was that?" — which is on us, not on you: we shipped that second installer, and you only had two copies because of it.
Nothing further needed from you. To summarise where this leaves things:
- Preview mode ignoring Ctrl+O, which is what you opened this for — fixed in 2.6.12.
- Preview scroll position — fixed in 2.7.1, confirmed by you.
- Home-screen Ctrl+O — not a defect; old build.
- Missing tabs — explained; not a defect.
- Duplicate install — caused by an installer we removed in 2.7.0/2.7.1; the copies it left behind cannot be upgraded by the normal installer, and Markpad only checks for updates when asked, so an unlaunched copy stays where it is.
- The file dialog freezing the app on an unreachable remembered folder — real, confirmed by you, and the one thing left.
Given that, I would close this one. Everything it was opened for is fixed, and the remaining bug shares nothing with the title but the person who found it. If you would open a fresh issue for the freeze — "file dialog freezes the app when the remembered folder is unreachable (WSL stopped)", plus the two results you just posted — it gets a title that matches, and it will not be read as a footnote to a three-month thread about a shortcut. Same for anything else you run into; a new issue each time is easier for both of us than one that keeps growing.
Separately, and not something you hit: while looking into the tabs I found that the Exit item in the ☰ menu deletes the saved session while ✕ saves it, and during startup the menu is the only control that responds. #503 stops the deleting half from happening during startup. Your report is what made me look, even though it turned out not to be your problem.