Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The readme states:
You have to install gzip, libarchive, tar, wget, ncurses, and less executables. Go to
http://gnuwin32.sourceforge.net/packages.html and install the packages.
However, a ncurses package for windows does not exist? It is not listed on http://gnuwin32.sourceforge.net/packages.html.
Comment | File | Size | Author |
---|---|---|---|
#10 | export_columns_refactored.patch | 1.87 KB | beltofte |
#8 | export_columns_on_windows_cmd_ps.patch | 1.8 KB | beltofte |
Comments
Comment #1
greg.1.anderson CreditAttribution: greg.1.anderson commentedThe ncurses requirement comes from the cygwin side. From the drush script:
# Note to cygwin users: install the ncurses package to get tput command.
If you are using drush.bat, you do not need ncurses. The documentation could use updating to explain this.
Comment #2
greg.1.anderson CreditAttribution: greg.1.anderson commentedNote, however, that without ncurses, drush does not know how to determine the width of the console.
On the DOS prompt, the console does not seem to get much larger than 84 columns, so drush's default of 80 works pretty well most of the time.
In Powershell,
(Get-Host).UI.RawUI.WindowSize
will return the width and height of the console. It would be necessary to create a drush cmdlet to utilize this.I don't know how to get the console width in msysgit.
stty size
is another way to get the screen size in Linux, but this command is not available in MINGW either.Comment #3
greg.1.anderson CreditAttribution: greg.1.anderson commentedSo, the point is that we should update the README and either say how this works, or document that it does not work.
Note that
stty size
does exist in cygwin, so perhaps we should use this instead of tput. Note, however, that I am not sure which cygwin package stty is included in.Comment #4
greg.1.anderson CreditAttribution: greg.1.anderson commentedpdcurses, mentioned in #1154380: Typo in README - Windows Installation, might help out here.
Comment #5
alexanderpas CreditAttribution: alexanderpas commentedThe width of the console in MS-DOS can be determined from the output of the
mode con
command.Comment #6
greg.1.anderson CreditAttribution: greg.1.anderson commentedThank you! This also works in Powershell, so #2 is not necessary. That still leaves mingw uncovered; perhaps we will use pdcurses there.
Comment #7
beltofteNot sure if it's relevant anymore, byt stty size is included in the sh-utils cygwin package, see http://cygwin.com/cgi-bin2/package-grep.cgi?grep=sh-utils.
Comment #8
beltofteHave made a patch exporting columns for CMD and PowerShell on Windows. It only works on PHP 5.3.0 and later. On previous PHP versions is columns always exported as 80. Guess the reason is that exec() starts a new CMD with the default settings.
Comment #9
greg.1.anderson CreditAttribution: greg.1.anderson commentedThat's a good start. Perhaps we should be more pragmatic about our column checking: rather than assuming that drush_is_cygwin will correctly determine whether stty is installed, just try to run 'stty size'. If the command fails and drush_is_windows is true (and php > 5.3.0 or later), then try 'mode con'.
Comment #10
beltofteRefactored the column checking. It now starts checking with "stty size" and if that fails and we are running on Windows and PHP 5.3.0 or later, are it trying with "mode con". Finally is it falling back to 80 columns if none of the checks succeeded.
Comment #11
greg.1.anderson CreditAttribution: greg.1.anderson commentedCode looks good. Now I've got two patches to test on Windows...
Comment #12
beltofteThanks, Greg :-)
Comment #13
greg.1.anderson CreditAttribution: greg.1.anderson commentedWorks great; good improvement. Committed.