Maximus5 / ConEmu

Customizable Windows terminal with tabs, splits, quake-style, hotkeys and more
https://conemu.github.io/
BSD 3-Clause "New" or "Revised" License
8.55k stars 572 forks source link

Any way to support win-sudo? #1783

Open axfelix opened 5 years ago

axfelix commented 5 years ago

https://github.com/imachug/win-sudo seems not to work under ConEmu (it works when running Git bash directly), presumably because it has to do weird stuff to capture another terminal process. Is this fixable?

Maximus5 commented 5 years ago

I suppose you should ask the author of win-sudo.

axfelix commented 5 years ago

Fair enough! I figured it would be easier for you to look at the way it's being wrapped rather than for them to anticipate how ConEmu works, but -- any interest, @imachug ?

purplesyringa commented 5 years ago

Will look into it.

purplesyringa commented 5 years ago

2018-12-16_21-45-19

The left terminal is ConEmu that runs bash, the right one is cmd that runs bash as well. I typed echo $$ to ConEmu, it echoed 11216. Then I typed echo $$ to cmd, it echoed 6856. However, if I run cat /proc/11216/fd/0, it starts echoing the current terminal, not the terminal with ID 11216. Same happens if I run cat /proc/6856/fd/0 -- typing data into the terminal makes it appear only in that terminal.

Sounds like a bug with attaching process IDs to consoles. @Maximus5

Maximus5 commented 5 years ago

What is bash from? WSL/MinGW? I see MinGW in the prompt. How did you run bash on the left and on the right?

I suppose you know, that mingw works differently when started from conhost (directly, bash.exe from Win+R) and from mintty. The same with ConEmu - directly and via connector.

axfelix commented 5 years ago

MinGW in my case too. And I start ConEmu directly (in that I have it pinned to my taskbar and it defaults to MinGW/Git Bash).

purplesyringa commented 5 years ago

What is bash from? WSL/MinGW? I see MinGW in the prompt.

Yes, it's MinGW (more specifically, git bash).

How did you run bash on the left and on the right?

Started C:\Program Files\Git\bin\bash.exe (or whatever the correct path is).

I suppose you know, that mingw works differently when started from conhost (directly, bash.exe from Win+R) and from mintty. The same with ConEmu - directly and via connector.

Hm, will check.

UPD: Turns out that opening classic Git Bash, running winpty bash and then sudo echo 1 doesn't really echo anything -- sounds like it could be the problem. Will I just have to conclude that I can't make it work with connectors?

axfelix commented 5 years ago

Maybe not until/if ConEmu decides to adopt https://blogs.msdn.microsoft.com/commandline/2018/08/02/windows-command-line-introducing-the-windows-pseudo-console-conpty/ ?

purplesyringa commented 5 years ago

@axfelix Yup, sounds like what we need. It would be awesome if ConEmu used this feature. @Maximus5

purplesyringa commented 5 years ago

@Maximus5 Just a quick question, have you changed anything regarding this issue? Seems like it was resolved (see the referenced issue), however I don't think there were any big changes since Dec 16.

axfelix commented 5 years ago

I just bumped my ConEmu to 190108 and it still doesn't seem to be working, should I bump my Git bash as well? I wouldn't think that would effect it...