1

msys is not opening programs interactively. For example, if I enter python, the program hangs. Even mysql hangs after I enter my password (entering the password is interactive, though). When I enter pico, I get "Redirection is not supported." bc does not hang, though. python -i opens an interactive session.

I've tried different terminal emulators, and I get the same results. I've tried Console and Mintty. Therefore, I'm led to believe this is an issue with sh, not the terminal emulator.

I am running Vista. I installed msys on my work PC, which runs Windows 7, and I don't have any issues with running interactive programs on msys.

I've read that this is expected behavior, but this used to work. I'm thinking that some install corrupted something. I even tried reinstalling msys, and I get the same results. I also cannot do system restore for some reason.

Any clues?

Here is some example output:

$ python
<ctrl-C> from this

$ mysql -u root -p
Enter password: ****
<ctrl-C> from this

This time I used Console. In the "Shell:" textbox I put C:/msys/1.0/bin/sh.exe --login -i When I press the enter key, a newline is added, i.e., the terminal scrolls. The same thing happens from the terminal provided by msys. This used to work before. Furthermore, I installed msys on another machine, which runs Windows 7, and python does not hang. If I use python -i, there is no hang.

Here's the output of running sh from cmd:

C:\Users\jpp>sh
sh-3.1$
sh-3.1$
sh-3.1$ python
Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>>
Community
  • 1
  • 1
user2233706
  • 6,148
  • 5
  • 44
  • 86
  • Everything that you say is completely false, you're simply misusing the shell. How do you open the shell? Show me exactly, in details, how you do that. – Alexander Shukaev May 15 '13 at 21:19
  • Here's how I open the the shell: `C:\msys\1.0\msys.bat -norxvt` This is a shortcut provided by msys. msys.bat is also a batch file provided by msys; I did not modify it. If I use Console, I set ` C:/msys/1.0/bin/sh.exe --login -i` in Edit->Settings->Shell – user2233706 May 16 '13 at 00:41
  • _"if I enter python, the program hangs"_ - give an example, how can I reproduce it. – Alexander Shukaev May 16 '13 at 00:44
  • I'm not sure how to indicate the programs hanging, but I've included the output. – user2233706 May 16 '13 at 01:51
  • So, if I understood you correctly something happened to MSYS, particularly on your current machine, i.e. it was fine before, but now it's not. Furthermore, on other machine everything is alright. Is that the case? – Alexander Shukaev May 16 '13 at 01:57
  • Yes. The machine that has the problem, runs Vista, and the machine that is OK has Windows 7; I'm not sure if this matters. I've reinstalled msys, and the problem is still there. – user2233706 May 16 '13 at 02:03
  • Let's keep it very simple: open Command Prompt (`cmd`) and type `sh`, then in this shell type `python`. What do you observe? – Alexander Shukaev May 16 '13 at 02:06
  • Works just fine. Included the output. – user2233706 May 16 '13 at 02:10
  • Same problem and observations here. Interesting that `python -i` works, I never realised. Until now, the only thing that worked interactively for me was `gdb` that came with MinGW. For me, interactivity doesn't work under `rxvt`, but works through `cmd.exe`. Some software, that usually ask `Y/n` questions skip them under MSYS rxvt, saying something along the lines of "Input not from interactive shell". – Evgeni Sergeev Dec 25 '13 at 04:39
  • Thanks. Can you confirm whether msys opened programs interactively before? msys used to work just fine. I installed something that caused this problem. – user2233706 Dec 27 '13 at 04:35
  • I had the Windows version of git installed. When I use git bash, which uses MinGW, I can open program interactively now. I'll switch to git bash. – user2233706 Jan 11 '14 at 05:19

1 Answers1

1

Have you tried the winpty (https://github.com/rprichard/winpty) project? For details, check my answer here: https://stackoverflow.com/a/23164362/1034436

Your issue seems similar to mine with mysql, hg and python, but unlike you, I don't have an example of it working without winpty.

Community
  • 1
  • 1
martian111
  • 595
  • 1
  • 6
  • 21