I use multiple workspaces and I open text files all the time.

Once upon a time Mousepad used to behave sanely and would open them in a new tab if there was already an instance on the current workspace, or open a new window (on the current workspace) if there wasn’t.

They broke that at some point. Now it’s anybody’s guess where the file will open. Maybe it opens in a tab in an existing window on this workspace. Maybe in a tab in a window on a random workspace. Maybe a new window on this workspace even though there’s one open. I’ve given up trying to figure it out.

As a last resort I can use wmctrl to figure out how to open the files and can script a sane launcher myself – provided that the editor has --tab and --window options AND lets you specify the window instance. Mousepad has the former but not the latter.

So, do you know any editor that can do it by itself or has those options so I can do it myself? TIA

  • @rtxn
    link
    English
    71 year ago

    If you open Emacs in daemon+client mode (run emacs --daemon once, then emacsclient to open the window), buffers that you open in one client will be available on all other clients, even concurrently. Judging from a quick test (on hyprland), it also seems to open the file in the client located on the focused screen, but does not automatically open a new client if there is one already running on any screen.