0

I'm sending commands to ConEmu using GuiMacro. The commands depend on the shell type (cmd/PowerShell/Bash).

How can a process running outside of ConEmu read shell type of specified ConEmu tab (e.g. by accessing its environment variables)?

There is GuiMacro GetInfo root which returns process name but since it returns info of the root process if I launch cmd tab and then run PowerShell I still get cmd.exe as process name while I expect to get powershell.exe.

1 Answer 1

0

You should code it yourself in your case. For example, you may walk through the process tree and find the first shell you've expected, having in mind that that "shell" might be non-interactive and most probably you need also to analyze the command line of that shell process.

The answer and checking logic may depend greatly on your use cases. ConEmu cannot detect all possibilities, that's why it simplifies the access to the root process only.

1
  • I can live with the risk of the shell being non-interactive. Can I somehow access the process name shown in the status bar?
    – jackhab
    Sep 22, 2021 at 5:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .