Implemented a single instance mode using a hard-coded named mutex.
In case another instance is run it opens a new tab in the single instance and exits. The new tab is either the Current working directory of the newly run instance or a tab defined using the command line arguments ( -t, -d, -r ).
In order to communicate, the new instance sends a WM_COPYDATA win32 message to a window with title == "Console". The message contains the tab name, command and directory.
The message is handled in MainFrame::OnCopyData which calls CreateNewConsole with the appropriate arguments.
The patch includes a rather quick and dirty hack of the above, together with some header files necessary to build the project ( I've spent a considerable amount of time trying to build it :/ ).
I'm really sorry I didn't have time to make this thing more robust and clean.
I have tested it and it seems to work on my rig pretty well.
Haven't tested any side effects it might have on other features, but I really doubt there should be any.
Log in to post a comment.