I am using the application TreeSheets, which is something like Excel on steroids. And I want to be able to view two "spreadsheets" side-by-side. Sadly, the application itself does not offer this as an option, and automatically puts each newly opened document in a new tab, without even the possibility to "arrange windows" within the main application window as known from Microsoft Office products.

Is there any trick to trick the application into starting a second time? Maybe something on a window manager level? (I am using KDE + xmonad; it is OK if it is a hack which happens to produce something ugly like a tab without visible menus or window decorations). Or maybe somehow forcing the program to start in a second, different process.

I don't need the two instances of the program to somehow "know" each other (as opposed to Excel spreadsheets where you can refer to the cells of a different spreadsheet file). All I need between the two is simple clipboard functionality for copying and pasting plain text.

I don't mind using inelegant tricks as long as it works. My current solution is to open the second spreadsheet on a second computer with Synergy; anything less painful is welcome.

  • 1
    The concept of tabs is entirely internal to the application: the window manager doesn't know about those. So any method to get separate windows would have to be specific to the application to some extent. – Gilles 'SO- stop being evil' Jan 13 '13 at 22:45
  • @Gilles I am OK with a method which starts two separate instances of the application, each with its own (internally managed) tabs. All methods I know (running treesheets from terminal, running it with Alt+F2, double-clicking a file) open the file in the already existing application instance. As for an internal-to-the-application method, I skimmed the documentation and could not find an option to start a new window the way e.g. firefox can be started with --no-remote. – rumtscho Jan 13 '13 at 23:15
  • For some time now Treesheets (2017 with wxWidgets 3.0, at least) has allowed multiple instances. It's not clear when the previous behaviour (enforced single instance) was changed, but it's a wxWidgets feature. Copy/paste works, changes made in one update the other window(s) on save (triggered by inotify). The limitation (no MDI with child windows) is due to wxWidgets. This type of MDI is only properly supported on MS Windows. wxWidgets on other platforms uses only a multi-tab UI to emulate it. – mr.spuratic Oct 16 '18 at 18:20

X servers have no notion of tabs or open files, so as far as the X server is concerned, TreeSheets is doing its own business in one window. You will have to convince TreeSheets to open separate windows somehow.

If the application lacks this feature, your only recourse is to launch separate instances. How to do that depends on how TreeSheets detects a running instance.

If TreeSheets depends on a lock file somewhere under your home directory, try running it with a different home directory:

HOME=/home/rumtscho/treesheets-instances/1 treesheets second-file

You'll have to copy or symlink your configuration files under /home/rumtscho/treesheets-instances/1.

If TreeSheets insists in ignoring the HOME environment variable, you may have to run it as a different user.

If TreeSheets looks for another window that belongs to the same application, you may have to run different instances on a different display. First, try fooling it by running on a different display:

ssh -X localhost treesheets second-file

If that fails, try the heavy-handed way: run TreeSheets inside a VNC client.

If TreeSheets is using D-Bus, try unsetting the environment variable DBUS_SESSION_BUS_ADDRESS.

There may be other ways, it all depends on how TreeSheets detects the running instance and communicates with it. Look for files that are created when you run TreeSheets, and what files it has open.

TreeSheets somefile &
# wait until the program has finished starting up
find ~/.[!.]* -mmin -5
lsof -p${!}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.