【问题标题】:How to interact with the console (input/output) running a Perl program on "Windows Power Shell ISE"?如何与在“Windows Powershell ISE”上运行 Perl 程序的控制台(输入/输出)交互?
【发布时间】:2012-03-09 15:43:02
【问题描述】:

我有一个需要在 Windows 7“Power Shell ISE”上运行的 Perl 程序(因为常规的 MS Windows 控制台不支持许多 Unicode 字体,而 PS-ISE 支持,我需要在Windows,使用 Perl)。

从常规 cmd 控制台运行 Perl 程序时,例如,
"Perl hello.pl";
程序运行,如果你打印一些东西,比如说
print "Hello world\n";
它得到打印在 cmd 框中。

我怎样才能在 PS-ISE 中做到这一点?在 PS-ISE 中,当我去时:
"Perl hello.pl"
它挂起。 PS-ISE 说:“正在运行脚本/选择。按 Ctrl+Break 停止”,但它不打印“Hello world”。
(接下来,我还需要接受来自 STDIN 的输入)。
重要提示:它是“Power shell ISE”,而不是:“Power Shell”。

【问题讨论】:

  • ">Perl .." 是拼写错误,还是您真的想将输出重定向到 Perl
  • 无重定向,直接命令。 (我想显示 shell 提示符)。

标签: windows perl powershell io


【解决方案1】:

正如我已经在 another answer 中详细阐述的那样,PowerShell ISE 不支持交互式 Windows 控制台应用程序。

另请注意,在处理 Unicode 文本时,控制台设置(尤其是字体)完全不相关。显示是另一回事。但对我来说,处理听起来不是那样的。

由于您在邮件中询问了 Console,here it is,正如网络搜索可能告诉您的那样(我认为我对来自 SO 用户的个人邮件表明了我的立场)。

【讨论】:

  • 我将您的答案提高了 1 并接受了答案。顺便说一句,在您提到的“另一个答案”中,您提到了“Console2”,而在 SourceForge 项目中,它显示为“Console”项目或 Console-2.00 等,因此很难找到它一个搜索引擎。您还提到您可以将 Console2 作为 cmdlet 运行?你能解释一下怎么做吗?
  • 我在哪里提到可以将 Console2 作为 cmdlet 运行?这对我来说是个新闻,尤其是如果据称我写了那篇文章。
猜你喜欢
  • 2014-02-28
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-03-15
  • 1970-01-01
  • 2012-12-27
  • 2012-01-10
相关资源
最近更新 更多