开发者

Missing "cpan>" prompt when running the CPAN shell in a Strawberry Perl environment under Cygwin

I've encountered a strange prompt problem when running the CPAN shell in a Strawberry Perl environment under Cygwin.

When launching the CPAN using perl -MCPAN -eshell I get the following output:

cpan shell -- CPAN exploration and modules installation (v1.9600)
Enter 'h' for help.

Please not that the standard cpan> prompt is missing. Why is that and how do I fix it?

When typing quit\n I get the prompt开发者_JAVA百科 but after I issue the command:

quit
cpan> Lockfile removed.


This is a basic problem running interactive windows programs in a cygwin terminal window. I don't have a handy cygwin installation to try it on, but try either

cygstart perl -MCPAN -eshell

or install conin and do

conin perl -MCPAN -eshell


If running git-bash (not cygwin), then start cpan with winpty:

winpty perl -MCPAN -eshell

The 'cpan> ' prompt should now be presented. You may get a warning:

Unable to get Terminal Size. The Win32 GetConsoleScreenBufferInfo call didn't work. The COLUMNS and LINES environment variables didn't work. at C:\Strawberry\perl\vendor\lib/Term/ReadLine/readline.pm line 410.

Which can be resolved by exporting the COLUMNS and LINES variables with the appropriate values. (Say):

export COLUMNS=80
export LINES=100

There are scripts that will pull the current window settings using bash, node or python.

bash:

export LINES=$(tput lines)
export COLUMNS=$(tput cols)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜