Skip to content
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

The ability to attach to windows as an automated task #2136

Open
ciolansteen opened this issue Jun 19, 2020 · 2 comments
Open

The ability to attach to windows as an automated task #2136

ciolansteen opened this issue Jun 19, 2020 · 2 comments

Comments

@ciolansteen
Copy link

ciolansteen commented Jun 19, 2020

Ok, this is not an issue but more a question about whether or not is possible to create a task that can attach a certain window if exists.

Also, if this is already in the docs, i couldn't find it so sorry in advance.

What i need:
I recently switched back to win10 after reading about wsl2 and its docker desktop integration and i'm really impressed and excited about all this. And more impressed that using ConEmu, I can finally embed a whole Xserver into a dropdown window which is ffffamazing

I want to have my editor and consoles in a drop down window. And i couldn't find a fast and responsive way to achieve this - mostly there are lag and drawing issues i faced so far.
So i decided to try and embed a full x server into a conemu window which works pretty well. This way i can have a basic window manger running there and all my console / editing tools inside.

It would be great if i had a task that can auto attach a certain window class (i guess) so i can start my x session only when i need it.

I'm sure that maybe there are saner ways for achieving the same thing but - like i said before -couldn't find any fast / responsive one other than using mintty (wsltty) for console tasks and external (independent) windows for gui. I even tried to attach a windows emacs gui to a conemu tab but without success (it seems that emacs.exe spawns a console that opens the actual gui so conemu will attach that console instead of the actual gui window).

Atm i managed to put this together and i'm pretty happy with it. The only thing missing is being able to auto-attach to the x server at conemu start or as a default task.

image

@Maximus5
Copy link
Owner

What is the problem with running console utilities in ConEmu? Do you really need to run Xserver and use graphic options?

As for you question about automation. Well, there is a GuiMacro function Attach but it accepts now only PID as argument.
It's possible to implement string arguments, attach by window Title for example.

@ciolansteen
Copy link
Author

ciolansteen commented Jun 20, 2020

I will keep testing those today and see if i can make it work smoothly.

I run wsl console applications like this (from here)

set "PATH=%ConEmuBaseDirShort%\wsl;%PATH%" & %ConEmuBaseDirShort%\conemu-cyg-64.exe %ConEmuBaseDirShort%\wsl\wslbridge2.exe -eConEmuBuild -eConEmuPID -eConEmuServerPID -l

and the rendering using zsh is really slow. Bash seems to be ok. I suppose this is because zsh gets translated by the wsl since bash is a windows console application. I understand ConEmu only "speaks" windows console. (chances are I am way orver my head wrong here. It's just a "first glance" impression).
So using Gui Children in this situation is a good alternative since I only need a dropdown window to put all my work related stuff into.

The best scenario I could get so far (without an automation) is to use x410 as a child gui. The problem is that if i try to attach to the resizable window before i start a X program, it doesn't work. If however i do this after I start any X app, the attachment work perfectly. also the resizing is just perfect. Maybe this could be a winner for running an X environment into a dropdown window.

Here's a speed comparison of all 3 scenarios (wslbridge, mintty child gui, X11 child gui)

2020-06-20-12-14-14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants