[ 
https://issues.apache.org/jira/browse/MNG-6915?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17239916#comment-17239916
 ] 

Guillaume Nodet edited comment on MNG-6915 at 11/28/20, 8:36 AM:
-----------------------------------------------------------------

Jansi provides all the methods needed to control the console.

On windows:
{code:java}
long outputHandle = Kernel32.GetStdHandle(Kernel32.STD_OUTPUT_HANDLE);
CONSOLE_SCREEN_BUFFER_INFO info = new CONSOLE_SCREEN_BUFFER_INFO();
Kernel32.GetConsoleScreenBufferInfo(outputHandle, info);
return new Size(info.windowWidth(), info.windowHeight()); {code}
and on unix:
{code:java}
CLibrary.WinSize sz = new CLibrary.WinSize();
CLibrary.ioctl(CLibrary.STDOUT_FILENO, CLibrary.TIOCGWINSZ, sz);
return new Size(sz.ws_col, sz.ws_row);
{code}
The return code of {{GetConsoleScreenBufferInfo}} and {{ioctl}} would have to 
be checked (they should fail in case the output has been redirected).



was (Author: gnt):
Jansi provides all the methods needed to control the console.

On windows:
{code:java}
long outputHandle = Kernel32.GetStdHandle(Kernel32.STD_OUTPUT_HANDLE);
CONSOLE_SCREEN_BUFFER_INFO info = new CONSOLE_SCREEN_BUFFER_INFO();
Kernel32.GetConsoleScreenBufferInfo(outputHandle, info);
return new Size(info.windowWidth(), info.windowHeight()); {code}
and on unix:
{code:java}
CLibrary.WinSize sz = new CLibrary.WinSize();
CLibrary.ioctl(CLibrary.STDOUT_FILENO, CLibrary.TIOCGWINSZ, sz);
return new Size(sz.ws_col, sz.ws_row);
{code}
The return code of {{GetConsoleScreenBufferInfo}} and {{ioctl}} would have to 
be checked (they should fail in case the output has been redirected).
{code:java}
 {code}

> Maven console output could be wider
> -----------------------------------
>
>                 Key: MNG-6915
>                 URL: https://issues.apache.org/jira/browse/MNG-6915
>             Project: Maven
>          Issue Type: Improvement
>          Components: Command Line
>    Affects Versions: 3.6.3
>         Environment: Apache Maven 3.6.3 
> (cecedd343002696d0abb50b32b541b8a6ba2883f)
> Maven home: C:\Java\apache-maven-3.6.3\bin\..
> Java version: 1.8.0_251, vendor: Oracle Corporation, runtime: C:\Program 
> Files\Java\jdk1.8.0_251\jre
> Default locale: en_US, platform encoding: Cp1252
> OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
>            Reporter: Gary D. Gregory
>            Priority: Minor
>         Attachments: 2020-05-22 18_14_44-Command Prompt.png
>
>
> Maven console output could be wider, either generally or by asking the 
> console its width. For example, when we build Log4j 2 3.0.0-SNAPSHOT, we get 
> the non-aligned summary attached as a screenshot.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to