Skip to content

Locked/View only mode #3688

Closed
Closed

Description

@madhermit

Describe your feature request

I would like a "locked" mode or a "view only" mode that would lock the screen and not allow any editing, intentional or errant.
Additionally, it would be nice if this mode auto-updated/auto-reloaded when the file changes on disk.

What problem does this feature solve? [optional]

I use MarkText mostly as a viewer and do my editing in Vim. When I want to read my notes I use MarkText for the clean and pretty syntax. Most of the time I'll have Vim and MarkText open side by side and type in Vim and view in MarkText. The requested mode would streamline this process (with the auto-reload) and prevent unintentional changes with the lock mode.

Thanks!

Activity

  1. andersonpem commented on Nov 8, 2023

    @andersonpem

    I also support this feature :)

  2. shantanu-wdev commented on Nov 11, 2023

    @shantanu-wdev

    I also support this feature :)

    +1

  3. aunjaffery commented on Dec 4, 2023

    @aunjaffery

    +1
    I want this Locking feature... Other then that marktext is pretty awesome.

  4. alexaschor commented on Sep 11, 2024

    @alexaschor

    This would be a lovely addition!

  5. Maziar123 commented on Oct 14, 2025

    @Maziar123

    me need also

  6. cocco580 commented on Apr 21, 2026

    @cocco580

    This feature it's very useful. It can built it as the fourth view mode, together with "Source Code", "Typewriter" and "Focus"

  7. dswicegood commented on May 21, 2026

    @dswicegood

    I support this as well, has this feature/fix been added yet? Every time I open a file, it marks it for edit even irrespective of whether I mutated/edited the content or not - I personally would consider this a bug because it doesn't enforce least-needed-privs or edit vs view. If it has not been addressed I will throw in a small donation to fix it or can also contribute if needed or it will help - I love the product but this makes it mostly unusable to me w/ VS Code w/ AI if I want to keep my flow.

    Thx for the cool product though, great work everyone!

  8. anandghegde commented on Sep 19, 2026

    @anandghegde
    Contributor

    I'd like to implement this and want to agree on the design before writing code. #2451, #3910, #4532 and #3745 ask for the same thing, so they could be closed as duplicates of this issue.

    Proposed behaviour:

    • A per-tab "Read-Only Mode" toggle in the View menu next to Typewriter/Focus, with a view.read-only-mode keybinding.
    • A preference, "Open files in read-only mode", off by default. It can still be switched off for a single tab.
    • A lock indicator on the tab while it is read-only.
    • In packages/muya, a setReadOnly(boolean) next to setFocusMode. It sets contenteditable="false" on the container and blocks input, paste, cut, drop and IME composition. It also suppresses the format, table, image and front-menu toolbars and task-checkbox toggling. Selection, copy, link clicks and search keep working.
    • A read-only tab can't have local edits, so when the file changes on disk it reloads without asking. That covers the "edit in Vim, read in MarkText" case in the original post.

    Out of scope: the legacy packages/muyajs, source-code mode, and a CLI flag.

    Questions:

    1. [Tracking Issue] Silent AST auto-formatting on open causes false unsaved state, cursor jumping, and Git diff pollution #5043 (normalising the document on open) makes files look dirty. I plan to have read-only tabs never be marked unsaved and never prompt to save, even if muya changed the content in memory. Does that fit your plan for [Tracking Issue] Silent AST auto-formatting on open causes false unsaved state, cursor jumping, and Git diff pollution #5043?
    2. Cmd+Option+R is already view.dev-reload on macOS. Should the new keybinding ship unbound?

    If this sounds right, I'll open a PR against develop.

  9. sid-the-sloth commented on Sep 26, 2026

    @sid-the-sloth

    desperately need this readonly / view only mode.
    ideally, when launching marktext with a file path, a CLI flag such as --readonly would be ideal.
    Thanks!

  10. self-assigned this
    on Sep 30, 2026
  11. jessicaione101 commented on Oct 2, 2026

    @jessicaione101

    I just want to reinforced the request. It would be nice to be able to click links directly in this mode too. Unless I'm missing something, right now I need to hover on the link and wait for an icon to appear, so I can click the icon to follow the link.

    I discovered Marktext recently and it's awesome. Thanks for all the great work!

    Update: I also use lots of HTML tags, like spam, to add color, and when I click on the text with them, it shows the tags. It would be nice if the tags don't show up on click in this read only mode.

  12. xronocode commented on Oct 19, 2026

    @xronocode

    This comes up a lot, so here's what works today.

    Mark, a Tauri 2 port of Mark Text I maintain (https://github.com/xronocode/mark), has a reading mode. View › Lock Document makes the current tab read-only, the tab header shows "Read-only", and a click on the page switches back to editing. There's also mark --preview file.md for the CLI, and a setting that opens documents launched from Finder in reading view. Downloads and overview: https://mark.xronocode.com

    Happy to write up how we did the read-only state over Muya if that's useful here.

  13. Jocs commented on Oct 19, 2026

    @Jocs
    Member

    17. This comes up a lot, so here's what works today.
    Mark, a Tauri 2 port of Mark Text I maintain (https://github.com/xronocode/mark), has a reading mode. View › Lock Document makes the current tab read-only, the tab header shows "Read-only", and a click on the page switches back to editing. There's also mark --preview file.md for the CLI, and a setting that opens documents launched from Finder in reading view. Downloads and overview: https://mark.xronocode.com
    Happy to write up how we did the read-only state over Muya if that's useful here.

    BTW, @xronocode the native support of reading mode is on the way #5793, Muya natively supports read-only mode; you are welcome to port Muya into your application when the time comes.

  14. xronocode commented on Oct 19, 2026

    @xronocode

    you are welcome to port Muya into your application when the time comes.
    Thanks @Jocs
    Interesting to see this coming to Muya natively. Watching #5793; we'll revisit porting fresh Muya once it lands.

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

Metadata

Metadata

Assignees

Labels

🦄 feature request🔭 area/ui

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions