You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The build panel, it is severally cutting out lines of its output
When running C++ program on the build panel, it is severally cutting out lines of the output if it contains invalid printable characters. What is the problem about this?
When you are programming and using the Build Panel to view your program output, you will be dammed if if accidentally try to print an string object, instead of a c string. You have not idea about what is going on. Whether is you program bugged, or if it is Sublime Text eating away your lines.
Expected behavior
It is expected to not cut several output lines just because of some bad character on them.
This is the example program presented on the Steps to reproduce section.
This output was generated by the shell terminal mintty 2.6.2 (x86_64-pc-cygwin):
Starting the main program...
argumentsCount: 3
argumentsStringList[0]: ./main
argumentsStringList[1]: argument1
argumentsStringList[2]: argument2
1. The string is ▒
2. The string is String
Exiting main(2)
Actual behavior
It is severally cutting out line of the output if it contains invalid printable characters.
This is the example program presented on the Steps to reproduce section.
This output was generated by the Sublime Output Build Panel, and it is cutting everything:
Starting the main program...
[Finished in 3.6s]
However, if you change the source code lines:
std::cout << format( "1. The string is %s", strin ) << std::endl;
std::cout << format( "2. The string is %s", strin.c_str() ) << std::endl;
To:
std::cout << format( "1. The string is %s", strin.c_str() ) << std::endl;
std::cout << format( "2. The string is %s", strin.c_str() ) << std::endl;
The Sublime Text correctly outputs:
Starting the main program...
argumentsCount: 3
argumentsStringList[0]: ./main
argumentsStringList[1]: argument1
argumentsStringList[2]: argument2
1. The string is String
2. The string is String
Exiting main(2)
[Finished in 3.8s]
The point is, it is a mistake to pass a std::string to the format specifier %s on the c format it is being used. A regular terminal, just output a recognizable character. Personally I do not care what is being printed, it is error to pass std::string, it must be a std::string s.c_srt(). The point is that Sublime Build output is not printing several lines, just because of an programmer error. This is really bad. A regular terminal can output the lines correctly, Sublime Text Build panel also should.
Why this is bad? When I am debugging, if several lines are being omitted, I am going to think they functions are not being called, instead of they lines are being hidden by Sublime Text.
By default the exec commands expects UTF-8 output, since this is fairly common. You can specify an encoding that will handle your specific output if you are outputting something else.
There is a bug currently in that it should be displaying [Decode error - output not utf-8], however an if condition is triggering and bailing out before that is appended. I will work on getting this fixed.
Build 3153 fixes the decoding error not shown issue with build system output and now uses the Python replace error handler when decoding, so bad chars will show up at unicode diamonds.
The build panel, it is severally cutting out lines of its output
When running C++ program on the build panel, it is severally cutting out lines of the output if it contains invalid printable characters. What is the problem about this?
When you are programming and using the Build Panel to view your program output, you will be dammed if if accidentally try to print an string object, instead of a
c string
. You have not idea about what is going on. Whether is you program bugged, or if it is Sublime Text eating away your lines.Expected behavior
It is expected to not cut several output lines just because of some bad character on them.
This is the example program presented on the Steps to reproduce section.
This output was generated by the shell terminal
mintty 2.6.2 (x86_64-pc-cygwin)
:Actual behavior
It is severally cutting out line of the output if it contains invalid printable characters.
This is the example program presented on the Steps to reproduce section.
This output was generated by the Sublime Output Build Panel, and it is cutting everything:
However, if you change the source code lines:
To:
The Sublime Text correctly outputs:
Steps to reproduce
1
Created this C++ program bellow named
main.cpp
:2
Create this shell script named
make_run.sh
:3
Create the Sublime Project
my.sublime-project
on the folder where yourmain.cpp
andmake_run.sh
are on:4
my.sublime-project
.Ctrl+Shift+B
and select the builderBuild Main file
.Environment
gcc (GCC) 5.4.0
overmintty 2.6.2 (x86_64-pc-cygwin)
The text was updated successfully, but these errors were encountered: