winpty icon indicating copy to clipboard operation
winpty copied to clipboard

Line output is clipped to 80 columns

Open ijustlovemath opened this issue 2 years ago • 0 comments

Hi,

I'm trying to support running a python script that redirects stdout in git-bash. I've settled on a magic invocation that seems to work:

winpty -Xallow-non-tty -Xplain python.exe -u /path/to/script.py > my_output_file.txt

However, lines longer than 80 characters that python redirects from stdout are clipped and the remainder moved to new lines. I did a little digging, and it seems like the problem might be that the size is set to 80 at program start:

    winsize sz = { 0 };
    sz.ws_col = 80;
    sz.ws_row = 25;

   // later...
   winpty_config_set_initial_size(agentCfg, sz.ws_col, sz.ws_row);

Is this the root of my problem? If so, would it be possible to change these values, within reason, from the command line?

No rush on this, it's for a side project.

ijustlovemath avatar Dec 14 '22 19:12 ijustlovemath