New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conemu - -reuse an instance, but don't bring it to the foreground #1245
Comments
That is by design. User expects the opened console ready to execute commands when they run a shell. |
But why does it only work only for the first shell? (perhaps the comment is out of date, I notice a related commit) In any case, here is my problem statement. I am using Conemu on an industrial scale, and I create a few windows, each containing up to 20 tabs. In general, I would like to have the ability to attach shells to conemu instances (as new tabs) without the conemu window coming to the foreground. I am open to suggestions on how to achieve that (the conemuc command line seems to have a few additional options, but I have yet to play with those, and I sense the foregroundness being strong on that side as well...). |
Switch By the way, why do you run tabs via |
I think the indended behaviour of combining those flags for the user it's clear: it should add a tab to a an existing conemu instance (when I have multiple instances this happens to be the last one that was opened), and minimise it if not already minimised. Is there some nasty coding required to achieve this?
This is the problem statement: The python script iterates a folder containing .sh files, and executes them one by one with the command above. The first file is executed without the "-reuse" switch, so as to create a new instance. Subsequent files are loaded with the -reuse switch so as to reuse said instance.
Through windows ftype/assoc mechanism. These is my setup script: assoc .py=Python.File
assoc .pyc=Python.CompiledFile
assoc .pyo=Python.CompiledFile
assoc .pyw=Python.NoConFile
assoc .pyz=Python.ArchiveFile
assoc .pyzw=Python.NoConArchiveFile
ftype Python.ArchiveFile="%%SXDEVICELIVE_ROOT%%\PAR\WinPython-64bit-3.5.2.2Qt5\python-3.5.2.amd64\python.exe" "%%L" %%*
ftype Python.CompiledFile="%%SXDEVICELIVE_ROOT%%\PAR\WinPython-64bit-3.5.2.2Qt5\python-3.5.2.amd64\python.exe" "%%L" %%*
ftype Python.File="%%SXDEVICELIVE_ROOT%%\PAR\WinPython-64bit-3.5.2.2Qt5\python-3.5.2.amd64\python.exe" "%%L" %%*
ftype Python.NoConArchiveFile="%%SXDEVICELIVE_ROOT%%\PAR\WinPython-64bit-3.5.2.2Qt5\python-3.5.2.amd64\pythonw.exe" "%%L" %%*
ftype Python.NoConFile="%%SXDEVICELIVE_ROOT%%\PAR\WinPython-64bit-3.5.2.2Qt5\python-3.5.2.amd64\pythonw.exe" "%%L" %%*
What would the advantage be? |
Did you ignored new ConEmu build? To run set of tabs simultaneously you may use The |
Indeed, I'm running an old build. Assume you've fixed the -reuse bit in the last build. If yes, thanks for that.
Looks good, thanks. I'll give that a shot
But I'm executing this from both windows explorer and also by just running the full path command with Windows+R (standard Windows Run dialog). So for that I believe I will have to hardcode a specific conemu title for -reuse in the ftype command. The problem is that -reuse will not take into consideration the "title" flag. It will reuse whatever last instance had focus. So I am looking at conemucexe? I can get the conemu window handle from the title with python and pass it as Am I down the right path, or am I missing something more concise to achieve the same? |
I don't understand why the |
[I've edited the previous comment to remove references to -title alongside -reuse. Currently, when you do -reuse you have no control on what window to reuse. It will be the last one that had focus on - and we agree that the title flag is ignored.] Now, how do I reuse a specific conemu windows, in the case when I have multiple ones open, and I do not want to reuse the last one, but a specific one (e.g. as identified by the title, or pid). |
You may use GuiMacro to create new tab in the specified window. It's upon your script to select it. |
Thank you I'll try and use that. |
ConEmu 170316 [32] {Preview}
OS version: Windows 8.1 x64
Used shell version (Far Manager, git-bash, cmd, powershell, cygwin, whatever): git-bash, cmd, powershell, cygwin (doesn't matter)
Problem description
Conemu - -reuse an instance shouldn't bring it to the foreground
I have also posted this on SU: https://goo.gl/DuMCd5
Steps to reproduce
I invoke it from python with:
Actual results
The Conemu window gets restored to the foreground
Expected results
The Conemu window stays minimised
Additional files
The text was updated successfully, but these errors were encountered: