Comments (9)
FWIW, I am able to use winpty successfully with both Cygwin and MSYS -- so presumably the problem's got something to do with our environments.
I reproduced the Cygwin problem by installing the mingw-gcc-g++ package. (Previously I only had the mingw-w64 stuff installed.) I think there's a bug in Cygwin's header:
/usr/i686-pc-mingw32/sys-root/mingw/include/winbase.h
#if (NTDDK_VERSION >= NTDDI_WIN2KSP2)
#define FILE_FLAG_FIRST_PIPE_INSTANCE 524288
#endif
I think the NTDDK_VERSION
was supposed to be NTDDI_VERSION
.
rprichard@vbwin7 /usr/i686-pc-mingw32/sys-root/mingw/include
$ grep NTDDK_VERSION -R .
./winbase.h:#if (NTDDK_VERSION >= NTDDI_WIN2KSP2)
rprichard@vbwin7 /usr/i686-pc-mingw32/sys-root/mingw/include
$ grep NTDDI_VERSION -R .
./sdkddkver.h:#define NTDDI_VERSION_FROM_WIN32_WINNT(ver) _NTDDI_VERSION_FROM_WIN32_WINNT(ver)
./sdkddkver.h:#define _NTDDI_VERSION_FROM_WIN32_WINNT(ver) ver##0000
./sdkddkver.h: * Version constants defining NTDDI_VERSION.
./sdkddkver.h:#ifdef NTDDI_VERSION
./sdkddkver.h:# if _WIN32_WINNT != OSDIR(NTDDI_VERSION)
./sdkddkver.h:# error The _WIN32_WINNT value does not match NTDDI_VERSION
./sdkddkver.h:# define _WIN32_WINNT WINNTVER(NTDDI_VERSION)
./sdkddkver.h:#ifndef NTDDI_VERSION
./sdkddkver.h:# warning NTDDI_VERSION is defaulting to _WIN32_WINNT version SPK0
./sdkddkver.h:# define NTDDI_VERSION NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT)
./winbase.h:#if (NTDDI_VERSION >= NTDDI_WINXPSP1)
./winbase.h:#endif /* (NTDDI_VERSION >= NTDDI_WINXPSP1) */
My mingw-w32api and mingw-runtime packages are up-to-date (version 4.0-1). (I'm not sure which package has the winbase.h header in it.)
from winpty.
I pushed a commit that should work around the Cygwin problem. Let me know how that goes.
I haven't looked at the MSYS problem yet.
from winpty.
Thank you very much Ryan!
Your workaround works great.
~/winpty-master
$ ./configure
uname -s identifies a Cygwin environment.
uname -m identifies a i686 environment.
Found Cygwin/MSYS G++ compiler: i686-pc-cygwin-g++
Found 32-bit MinGW G++ compiler: i686-pc-mingw32-g++
Writing config-unix.mk
Writing config-mingw.mk
~/winpty-master
$ make
cd agent && make
make[1]: Entering directory '/home/User/winpty-master/agent'
Compiling EventLoop.cc
Compiling NamedPipe.cc
Compiling Agent.cc
Compiling AgentAssert.cc
Compiling Terminal.cc
Compiling Win32Console.cc
Compiling ConsoleInput.cc
Compiling ../shared/DebugClient.cc
Compiling Coord.cc
Compiling SmallRect.cc
Compiling main.cc
Linking ../build/winpty-agent.exe
make[1]: Leaving directory '/home/User/winpty-master/agent'
cd libwinpty && make
make[1]: Entering directory '/home/User/winpty-master/libwinpty'
Compiling winpty.cc
Compiling ../shared/DebugClient.cc
Linking ../build/winpty.dll
make[1]: Leaving directory '/home/User/winpty-master/libwinpty'
cd unix-adapter && make
make[1]: Entering directory '/home/User/winpty-master/unix-adapter'
Compiling main.cc
Compiling Shared.cc
Linking ../build/console.exe
make[1]: Leaving directory '/home/User/winpty-master/unix-adapter'
The testcase works fine too now. :)
$ console /cygdrive/c/Python27/python.exe
Python 2.7.8 (default, Jun 30 2014, 16:03:49) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
The winbase.h
is in the package mingw-w32api-4.0-1.
from winpty.
I think it wasn't a good idea to use the MSYS version in Cygwin. I'll try the MSYS version in MSYS tomorrow and I think it will work.
Btw. Could you add the https://github.com/rprichard/winpty/downloads/ page to the README.rst please? I totally overlooked the already compiled packages at the beginning.
Btw2. You could add make
to the Cygwin packages for completeness. (README.rst)
from winpty.
I'm sorry - the MSYS version works fine in MSYS.
Do you have a real testcase for winpty in MSYS? Because in MSYS python works also without winpty.
from winpty.
MSYS is basically the same as Cygwin -- both of them can be used inside a
Windows console (i.e. the clunky "DOS box"), in which case, the native
Windows Python will work fine. Alternatively, they can be run inside an
emulated pty using a terminal emulator like mintty. In that case, the
native Windows Python will see the pty as a vanilla Windows pipe and fail.
A good way to test MSYS and winpty is to install the MSYS version of
mintty. It looks like there's a mintty-1.1.3-msys.zip binary for download
on the mintty site, or you might be able to use a package manager too (e.g.
"mingw-get install mintty").
-Ryan
On Thu, Sep 18, 2014 at 7:44 AM, shiek [email protected] wrote:
I'm sorry - the MSYS version works fine in MSYS.
Do you have a real testcase for winpty in MSYS? Because in MSYS python
works also without winpty.—
Reply to this email directly or view it on GitHub
#27 (comment).
from winpty.
Ah - thank you for pointing that out. I never used MSYS before yesterday -- just Cygwin all the time.
I thought this basic MSYS shell is like mintty in Cygwin.
from winpty.
I don't know if this is the place to post this but this info should help a lot
msys from mingw.org is very very old like 5/6 years old
There is the msys2 project that i am a contributor to and I've even added winpty as a package.
We unlike msys have a package manage. pacman borrowed from arch linux.
Where we keep every component of the shell up to date
See here http://msys2.github.io
So we have bash 4.3 and all the latest autotools etc.
our mintty is the latest from trunk and
We use the latest mingw-w64 headers and toolchains.
mingw.org toolchains are also very old and dont support x64 and armv7.
As a result most linux distros have switched to mingw-w64
from winpty.
I added make
to the Cygwin and MSYS2 package lists in the README.
I think I'll upload new binaries at some point. The ones at https://github.com/rprichard/winpty/downloads are a few years old now, assume 32 bits, and lack various bugfixes. (They break badly on Windows 10.) Issue #32 covers that, though.
The FILE_FLAG_FIRST_PIPE_INSTANCE
bug was fixed in the winbase.h
header, http://sourceforge.net/p/mingw/bugs/2050/. If I remove my hack, my code compiles fine with:
- MSYS1/MinGW (installed using mingw-get)
- MSYS2 (installed via https://msys2.github.io/ and pacman)
- MinGW-w64 in Cygwin
It still fails using the original MinGW installed via Cygwin. Maybe no one is updating its w32api package? In any case, I changed the configure
script to prefer MinGW-w64 over MinGW for Cygwin.
from winpty.
Related Issues (20)
- Error creating winpty: lost connection to agent?
- Is there a way to avoid winpty to set the terminal's title?
- Global configuration (g_DebugConfig) is leaked.
- xagrs return info lose slash
- "winpty bash" doesn't work from "Enter-PSSession -Computer myServer"?
- Missing text colors in MINGW64 when program runs with winpty HOT 2
- [NOTE!!!] Added support for VCPKG/CMake/dynaic+static linkage/arm64
- PREFIX environmental variable does not change installation directory
- Can not scroll buffer when using windows builtin telnet client in cygwin/msys2/vscode terminal etc
- Add support for Windows ARM HOT 2
- 'Pty is closed.' BUG in my app
- Line output is clipped to 80 columns
- Error when building under cygwin: cygwin_conv_to_win32_path was not declared in this scope HOT 3
- does libwinpty has a way to detect cmd.exe needs a input? HOT 2
- how to render CSI n G?
- winpty clears screen in Git Bash HOT 3
- How to install winpty on Windows HOT 4
- Unknown Issue when Installing CodeCompanion
- xp version binaries will not run on xp systems. HOT 1
- Prompt issue
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from winpty.