Comments (8)
I'm seeing a "The system cannot find the path specified." error using winpty. I'm looking into it.
from winpty.
Probable workaround: mintty sets TERM
to xterm
. Instead, unset it or set it to dumb
before running IronPython.
Long version:
- At startup, if
TERM
is unset, IronPython sets it todumb
instead. https://github.com/IronLanguages/main/blob/ipy-2.7-maint/Languages/IronPython/IronPythonConsole/Console.cs "Work around issue w/ pydoc - piping to more doesn't work so instead indicate that we're a dumb terminal" sys.platform
on IronPython iscli
notwin32
- I think
getpager
in https://github.com/IronLanguages/main/blob/ipy-2.7-maint/External.LCA_RESTRICTED/Languages/IronPython/27/Lib/pydoc.py is that code that runs forhelp(0)
. The expected behavior is that IronPython uses theplainpager
that just dumps help to stdout. In the broken winpty case, IronPython uses thelambda text: pipepager(text, 'more')
pager, which (apparently?) does nothing. I don't really know what's up here.
Setting TERM
to dumb will fix the problem.
FWIW, I've been considering having the winpty console
program set TERM
. winpty operates a hidden Windows console, so I've been thinking winpty should set TERM
the same way that Cygwin would set it for a Windows console, which is TERM=cygwin
. Doing so fixes a cursor key problem with less
.
However, TERM=cygwin
doesn't work for IronPython. Only TERM=dumb
does.
So, maybe the right behavior is for console
to unset TERM
? Cygwin programs shouldn't care -- the Cygwin library will notice that it's running under a console. For non-Cygwin programs, TERM=xterm
seems strictly more wrong than an unset TERM
.
from winpty.
I tried export TERM=dumb
and export TERM=
. Either of them worked. The output of help(0)
in the IronPython prompt was still empty.
Still thank you a lot for your effort on this issue.
from winpty.
Could you tell me the versions of software you're using? In particular, I'd like to know what version of IronPython, winpty, and Cygwin DLL you're using, but other details like OS version, 32/64-bitness, and mintty version might help. Are you're using a precompiled winpty binary?
One idea I had -- maybe instead of clearing the TERM variable before invoking console
, clear it inside the winpty console, e.g.:
mintty prompt> console cmd
cmd prompt> set TERM=
cmd prompt> cd /D "C:\Program Files\IronPython 2.7"
cmd prompt> ipy
ipy prompt> help(0)
from winpty.
Ironpython: 2.7.4 (32bit)
winpty: 0.1.1 (precompiled)
cygwin: 1.7.30 (32bit)
Windows 8.1 (64bit)
mintty: 1.1.3
Your new idea didn't work either. The TERM
in cmd
is dumb
before setting it to empty. Thank you.
from winpty.
Do you have a PAGER
environment variable set? When I set it to less
, I notice that help(0)
stops working in IronPython. (Actually, IronPython doesn't seem to work with any PAGER
setting. Even PAGER=more.com
breaks it, with no winpty involvement. CPython works with PAGER=more.com
.)
What does pydoc.getpager() evaluate to, for you? For me, with TERM=dumb
, it's plainpager
. If I set a PAGER
, then I instead get a lambda.
rprichard@vbwin7 /cygdrive/c/Program Files/IronPython 2.7
$ /cygdrive/c/rprichard/winpty-0.1.1-cygwin/console.exe cmd
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Program Files\IronPython 2.7>set TERM=
C:\Program Files\IronPython 2.7>set PAGER=
C:\Program Files\IronPython 2.7>ipy
IronPython 2.7.4 (2.7.0.40) on .NET 4.0.30319.18444 (32-bit)
Type "help", "copyright", "credits" or "license" for more information.
>>> import pydoc
>>> pydoc.getpager()
<function plainpager at 0x000000000000002B>
>>> ^Z
C:\Program Files\IronPython 2.7>set PAGER=more.com
C:\Program Files\IronPython 2.7>ipy
IronPython 2.7.4 (2.7.0.40) on .NET 4.0.30319.18444 (32-bit)
Type "help", "copyright", "credits" or "license" for more information.
>>> import pydoc
>>> pydoc.getpager()
<function <lambda$95> at 0x000000000000002B>
from winpty.
Awesome. After set TERM=
and set PAGER=
, help(0)
worked! Thank you so much for taking care of this.
from winpty.
I think this issue is fixed now?
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.