Skip to content

[Feature] Drag tabs into new windows and move tabs between windows #6112

Open

Description

@Gentle-Code0

Summary

Allow users to drag a tab out of its current window to create a new window, and drag a tab onto another window’s tab bar to move it there. Keep the tab bar visible even when a window contains only one tab.

Problem it solves

I frequently need this functionality when working with multiple Markdown documents across multiple monitors.

These actions would make it easier to:

  • Move a document into a separate window for reference or comparison.
  • Bring documents back into the same window when separate windows are no longer needed.
  • Reorganize documents without closing and reopening files or losing editing context.

Proposed solution

Basic interactions

  1. Keep the tab bar visible.
    Even when a new window contains only one tab, show both the tab bar and that tab so the user can drag it.

  2. Drag a tab out to create a new window.
    Dragging a tab outside its current window and releasing it should move that document into a new MarkText window near the drop position.

  3. Drag a tab onto another window’s tab bar to move it there.
    Dragging a tab from one MarkText window onto another window’s tab bar should move that tab into the destination window. Remove the source tab only after the transfer succeeds. Once all tabs have been moved out of the source window, it should return to its default blank-document state.

The destination tab bar could highlight when it can accept a drop and show the insertion position. Incoming tabs should retain their relative order.

Behavior and implementation considerations

The following are potential issues I have identified so far that may need additional consideration.

1. Preserve document state

Moving a tab should preserve its unsaved content, undo/redo history, scroll position, and editing mode. New untitled documents should also be transferable without requiring the user to save them first.

2. Handle files with the same name and duplicate documents

Documents with the same filename but different paths should remain separate tabs. A parent-folder label or full-path tooltip could help distinguish them.

If the destination window already has the same file open, with the same name and location:

  • If neither copy has unsaved changes, block the transfer and prompt the user to save or synchronize the documents.
  • If either copy has unsaved changes, the operation must not silently overwrite or discard either version. MarkText could ask the user which version to keep.
  • Separate untitled documents should remain independent, even if they have the same display name.

3. Make transfers safe and recoverable

Remove the source tab only after the destination window confirms that it has received the document state and that the transfer has succeeded.

If the transfer fails or is cancelled, the document should remain available in the source window. A two-step prepare/confirm process might help prevent data loss caused by partial failures.

4. Account for window settings and workspaces

Moving tabs between windows may bring together documents from different workspace roots. I am unsure whether two windows can have different base-directory settings. If this is possible, the behavior needs to be defined so that relative image paths, file links, and save locations continue to resolve correctly.

5. Provide clear feedback and prevent accidental actions

A minimum drag distance or a hover delay before accepting a transfer could help prevent accidental detaching or moving. Pressing Escape should cancel the operation.

If a drop does not result in a valid transfer, the source window should remain intact.

6. Consider platform limitations

I only use MarkText on Windows, so I am unfamiliar with how windows and tabs should behave on macOS or Linux.

Alternatives considered [optional]

If this drag-and-drop interaction cannot be supported on other platforms, each tab’s context menu could provide “Move Tab to Window…” and “Move Tab to New Window” actions. These actions could also be exposed for keyboard access and accessibility.

Additional context [optional]

These are my current ideas and considerations. I intend to try implementing this myself, but before starting, I would appreciate feedback from the maintainers on the interaction design, platform limitations, and handling of duplicate documents, particularly anything I may have overlooked.

Activity

  1. added 17 commits that reference this issue on Nov 23, 2026
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions