如何让 ActivePerl 与 cygwin 的屏幕完美配合?
我想使用 cygwin 工具(屏幕)进行开发,并从 cygwin 环境调用 ActiveState Perl 调试器会引发以下错误。
bash-3.2$ perl -d test.pl
The system cannot find the path specified.
Unable to get Terminal Size. The Win32 GetConsoleScreenBufferInfo call didn't work. The COLUMNS and LINES environment variables didn't work. The resiz
e program didn't work. at F:/Perl/lib/Term/ReadKey.pm line 362.
Compilation failed in require at F:/Perl/lib/Term/ReadLine/Perl.pm line 64.
at F:/Perl/lib/Term/ReadLine/Perl.pm line 64
Term::ReadLine::Perl::new('Term::ReadLine', 'perldb', 'GLOB(0x18e2e0c)', 'GLOB(0x1883e14)') called at F:/Perl/lib/perl5db.pl line 6073
DB::setterm called at F:/Perl/lib/perl5db.pl line 2237
DB::DB called at testReliance1.pl line 2
Attempt to reload Term/ReadLine/readline.pm aborted.
Compilation failed in require at F:/Perl/lib/Term/ReadLine/Perl.pm line 64.
END failed--call queue aborted at testReliance1.pl line 64.
at testReliance1.pl line 64
bash-3.2$
我找不到任何解决方法。
尝试使用 cygwin perl distrubution,但是在 cpan 下编译 perl 模块对我来说是一场噩梦,因为它们中的大多数都无法编译并且没有深入的知识来修复编译器错误。
为调试器提供一个假终端可能有效,但不知道可行性以及如何继续。
请建议是否有任何解决方法。
I would like to use cygwin tools (screen) for development and invoking ActiveState Perl debugger from cygwin environment throws the following error.
bash-3.2$ perl -d test.pl
The system cannot find the path specified.
Unable to get Terminal Size. The Win32 GetConsoleScreenBufferInfo call didn't work. The COLUMNS and LINES environment variables didn't work. The resiz
e program didn't work. at F:/Perl/lib/Term/ReadKey.pm line 362.
Compilation failed in require at F:/Perl/lib/Term/ReadLine/Perl.pm line 64.
at F:/Perl/lib/Term/ReadLine/Perl.pm line 64
Term::ReadLine::Perl::new('Term::ReadLine', 'perldb', 'GLOB(0x18e2e0c)', 'GLOB(0x1883e14)') called at F:/Perl/lib/perl5db.pl line 6073
DB::setterm called at F:/Perl/lib/perl5db.pl line 2237
DB::DB called at testReliance1.pl line 2
Attempt to reload Term/ReadLine/readline.pm aborted.
Compilation failed in require at F:/Perl/lib/Term/ReadLine/Perl.pm line 64.
END failed--call queue aborted at testReliance1.pl line 64.
at testReliance1.pl line 64
bash-3.2$
I couldn't find any workaround for this.
Tried to use cygwin perl distrubution,but compiling perl modules under cpan is nightmare for me as most of them won't compile and don't have in-depth knowledge to fix compiler errors.
Providing a fake terminal for debugger may work but no idea about feasibility and how to proceed.
Please suggest if there is any workaround for this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
来自 Term::ReadLine 文档的 “环境”部分 :
作为解决不兼容性问题之前的解决方法,您可以禁用 Term::ReadLine
From the "Environment" section of the Term::ReadLine documentation :
As a workaround until the incompatibility is sorted out, you can disable Term::ReadLine with
请记住,Windows 控制台提供了与常规 *nix 控制台截然不同的环境。一般来说,想要与控制台交互的 Windows 应用程序无法在 Cygwin 控制台(如 MinTTY、XTerm、Screen)中运行,因为它们只提供 PTY 模拟。
MinTTY 的作者 Andy Koppe 撰写了一个名为 conin 的小程序,允许 Windows 程序像从控制台一样读取,但完整的输出支持仍被认为不可行。
Remember that the Windows console provides a very different environment to your regular *nix console. In general, Windows applications that want to interact with the console won't work in Cygwin consoles (like MinTTY, XTerm, Screen) because they only provide PTY emulation.
Andy Koppe, author of MinTTY, has written a small program called conin to allow windows programs to read as if from the console, but full output support is still considered infeasible.
在我看来,你好像遇到了很多问题。 ActiveState Perl 是一种将 Perl 移植到 Windows 的尝试,具有模块的二进制分发和版本控制,这种方法正在消亡。 strawberry perl 的成功和我的个人经验让我认为您只是使用了错误的产品。
我只用草莓,自从移民以来我遇到的问题数量一只手就能数得过来。我很高兴从 ActiveState 转换过来。我建议你也尝试一下。 Strawberry 附带了一个 mingw 环境——它甚至会为您编译 XS 模块,并且它为您打开了一个纯粹的 CPAN。
(这是一个完全不同寻常的答案,但我相当确定我已经在 cygwin 中使用了草莓 perl 的 bin,并且它已经起作用)
解决方案 - 使用 Cygwins Term ReadKey
本质上,您只需要 Cygwin
Term::ReadKey< /code> 在你的 lib 啄食顺序中处于较高位置,以便使用它。
或。
从 Cygwin 运行此命令。
无论该值是什么,请从您的 Strawberry 安装中编辑 Term/ReadKey.pm 并将其手动破解,设置一个变量
my $termoption = value_you_got from 上述
&termsizeoptions(),与
$termoption
It seems to me as if you're having a lot of problems. ActiveState Perl is an attempt at a port of Perl to windows with binary-distribution and version control for modules, this approach is dieing. The success of strawberry perl and my personal experience makes me think you're simply using the wrong product.
I use strawberry exclusively and the amount of problems that I've experienced since migration I can count on one hand. I'm very happy having converted from ActiveState. I'd suggest you give it a shot too. Strawberry comes with a mingw environment -- it will even compile XS modules for you, and it opens you up to an unadulterated CPAN.
(this is a totally off beat answer, but I'm fairly certain I've used strawbery perl's bin in cygwin and it has worked)
Solution - Use Cygwins Term ReadKey
Essentially, you simply need the Cygwin
Term::ReadKey
to sit higher in your lib pecking order so it is used.or.
Run this, from Cygwin.
Whatever that value is, edit Term/ReadKey.pm from your Strawberry install hand-hack it in there, set a variable
my $termoption = value_you_got from above
&termsizeoptions()
, with$termoption
在运行 Perl 之前尝试运行此命令:
Try running this command before you run Perl:
使用与 ActiveState perl 一起打包的 wperl.exe。这往往可以正常工作。
Use wperl.exe which is packaged with ActiveState perl. This tends to work properly.