Conemu: Python not working in Git Bash

Created on 24 Jun 2018  路  4Comments  路  Source: Maximus5/ConEmu

Versions

ConEmu build: 180617 x64
OS version: Windows 10 x64
Used shell version (Far Manager, git-bash, cmd, powershell, cygwin, whatever):

  • Git Bash, Git-2.17.1.2-64-bit.exe

Problem description

Before this, when I keyed in python, I was able to use it normally without the need for winpty in ConEmu. I assume this was handled in the background by ConEmu?

I recently have issues with a tmux window in Vagrant, which was SSH-ed into from Git Bash. I read how there is a msys connector now which fixes most issues, and promptly updated. I have also reset my tasks to default, so Git Bash actually runs the command below.

# added newlines for easier reading
set "PATH=%ConEmuDrive%\Program Files\Git\usr\bin;%PATH%" &
"%ConEmuDrive%\Program Files\Git\git-cmd.exe" --no-cd
--command=%ConEmuBaseDirShort%\conemu-msys2-64.exe
/usr/bin/bash.exe -l -i -new_console:p

The issue with tmux was fixed, but after updating, I noticed that running Python on Git Bash just hangs there indefinitely without any response. I have to forcefully terminate the Git Bash window. Running Python with winpty seems to make it work though. I have resorted to resetting all my settings in ConEmu to default as well, but it is still not working.

Steps to reproduce

  1. Start ConEmu, and open a Git Bash window
  2. Try to run python
  3. The window should not give any response

Actual results

I am expecting to see Python interactive terminal.

Expected results

Git Bash windows in ConEmu hangs indefinitely.

other-cygwimsys

Most helpful comment

add this line to your .bashrc:

alias python='winpty python.exe'

All 4 comments

There are absolutely different console modes supported in ConEmu: WinAPI and POSIX.

If you do run git-bash without ConEmu and try to run Python you have the same result, isn't it? So the problem should not be reported here.

ConEmu (and connector) have never done winpty trick. How? I even do not inject ConEmuHk in POSIX processes.

The only available solutions:

  • Use python from git-bash distro. It should be compiled for POSIX. If it does not - report to git-bash-for-windows maintainer.
  • Use ConEmuC -std -c python instead of winpty because it does proper trick.

If you do run git-bash without ConEmu and try to run Python you have the same result, isn't it?

Yeap, running Git Bash without ConEmu reproduces the issue as well.

Understood, and thanks for your confirmation.

add this line to your .bashrc:

alias python='winpty python.exe'

I do not recommend to use third party tools especially when the feature was implemented in ConEmu almost a year ago!
https://github.com/Maximus5/ConEmu/issues/1616#issuecomment-399752744

Was this page helpful?
0 / 5 - 0 ratings