Excessive blank lines in briefcase output on MSYS2
Describe the bug
I'm okay with using a blank line to separate each major action, but Briefcase often outputs even more than that. For example:
(bw-3.10) smith@xanadu:~/git/beeware/test0927$ briefcase create windows
Application 'test0927' already exists; overwrite [y/N]? y
[test0927] Removing old application bundle...
[test0927] Generating application template...
Assigning test0927 an application GUID of c57e7760-5885-5105-8315-53fc1f32f2d3
Using app template: https://github.com/beeware/briefcase-windows-app-template.git, branch v0.3.10
Using existing template (sha f0d27880768f39f22c639a9e1abd8c7864072f0a, updated Tue Sep 20 15:53:52 2022)
[test0927] Installing support package...
Using support package https://www.python.org/ftp/python/3.10.7/python-3.10.7-embed-amd64.zip
python-3.10.7-embed-amd64.zip already downloaded
Unpacking support package... done
[test0927] Installing dependencies...
Collecting toga-winforms>=0.3.0.dev34
Using cached toga_winforms-0.3.0.dev36-py3-none-any.whl (327 kB)
Collecting toga-core==0.3.0.dev36
Using cached toga_core-0.3.0.dev36-py3-none-any.whl (493 kB)
Collecting pythonnet>=3.0.0a1
Using cached pythonnet-3.0.0rc6-py3-none-any.whl (278 kB)
Collecting travertino>=0.1.3
Using cached travertino-0.1.3-py3-none-any.whl (15 kB)
Collecting clr-loader<0.3.0,>=0.2.2
Using cached clr_loader-0.2.3-py3-none-any.whl (50 kB)
Collecting cffi>=1.13
Using cached cffi-1.15.1-cp310-cp310-win_amd64.whl (179 kB)
Collecting pycparser
Using cached pycparser-2.21-py2.py3-none-any.whl (118 kB)
Installing collected packages: travertino, pycparser, toga-core, cffi, clr-loader, pythonnet, toga-winforms
Successfully installed cffi-1.15.1 clr-loader-0.2.3 pycparser-2.21 pythonnet-3.0.0rc6 toga-core-0.3.0.dev36 toga-winforms-0.3.0.dev36 travertino-0.1.3
Installing app dependencies... done
[test0927] Installing application code...
Installing src/test0927... done
[test0927] Installing application resources...
Installing src/test0927/resources/test0927.ico as application icon... done
[test0927] Removing unneeded app content...
No app content clean up required.
[test0927] Created windows\app\test-0927
(bw-3.10) smith@xanadu:~/git/beeware/test0927$ briefcase run
[test0927] Starting app...
===========================================================================
Unable to start app test0927.
Log saved to C:\Users\smith\cygwin\git\beeware\test0927\briefcase.2022_09_27-21_17_14.run.log
(bw-3.10) smith@xanadu:~/git/beeware/test0927$
Expected behavior
There should be no blank lines at the very start, or at the very end.
Every other case of two blank lines should be reduced to one.
Environment:
- Operating System: Windows 10 with MSYS2 console
- Python version: 3.10
- Software versions:
- Briefcase: 9ab31c827263
The two blank lines are interesting; they are single blank lines for me in linux and windows (without MSYS2).
However, I notice the two blank lines only show after the "done message" for the Wait Bar is printed...and not after "normal" print statements. Perhaps there are some control characters being emitted there that MSYS2 is picking up as an additional new line. Further, these double new lines have showed up in the tests; I've occasionally noticed that an extra \n was necessary to satisfy the tests when the Wait Bar output was included...
As for the new lines at start and exit: those will be likely overly pesky to prevent since it can be hard to know, in general, when something is the first thing or last thing to be printed.
I've occasionally noticed that an extra \n was necessary to satisfy the tests when the Wait Bar output was included
Can you point at some examples?
Can you point at some examples?
This is what I was thinking of: https://github.com/beeware/briefcase/pull/810/files/ad8ed939de547cbbf018c55395e8577d9a31786f#r938321811
MSYS2 has console issues with many different programs, not just Briefcase. And I don't think it's popular enough to be worth the effort of fixing them on our side.