Bug 430055 - Bash escape sequences visible in the output of qalculate
Summary: Bash escape sequences visible in the output of qalculate
Status: RESOLVED FIXED
Alias: None
Product: cantor
Classification: Applications
Component: qualculate-backend (show other bugs)
Version: 20.08
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: Nikita Sirgienko
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-12-05 21:00 UTC by Joshua Houghton
Modified: 2020-12-06 22:26 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 20.12.1
Sentry Crash Report:


Attachments
Screenshot of qualculate and cantor side by side (1.16 MB, image/png)
2020-12-05 21:00 UTC, Joshua Houghton
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Joshua Houghton 2020-12-05 21:00:45 UTC
Created attachment 133895 [details]
Screenshot of qualculate and cantor side by side

SUMMARY
Qalculate now applies colours to it's output. Cantor however fails to parse the bash escape sequences and therefore outputs garbase

STEPS TO REPRODUCE
1. Create a thing with the qalculate backend
2. Run this mathematical expression ((-2)^3.3)
3. You'll see the following garbage in the output 
(−[0;36m2[0m)^[0;36m3.3[0m ≈ [0;36m−[0m[0;36m5.789188237[0m − [0;36m7.968134023[0m[0;33mi[0m
4. Run this mathematical expression integrate(asin(x))
5. You'll see the following garbage in the output
integrate(arcsin([0;33m[3mx[23m[0m)) = [0;33m[3mx[23m[0m × arcsin([0;33m[3mx[23m[0m) + √([0;36m1[0m − [0;33m[3mx[23m[0m^[0;36m2[0m) + [0;33m[3mC[23m[0m

OBSERVED RESULT

See screenshot attached. Look at the output from cantor

EXPECTED RESULT

See screenshot attached. Look at the top left terminal

SOFTWARE/OS VERSIONS
SOFTWARE/OS VERSIONS
Qt Version: 5.15.1
Frameworks Version: 5.75.0
Operating System: Linux 5.9.11-200.fc33.x86_64 x86_64
Windowing system: X11
Distribution: "Fedora release 33 (Thirty Three)"
qalculate: 3.15.0

ADDITIONAL INFORMATION

I was going to look into this issue myself but when i tried to compile and run cantor i couldn't https://bugs.kde.org/show_bug.cgi?id=430045. I did eventually manage to get it to start but i feel i should probably be getting on with other things now.

I have tested the following versions of cantor and can confirm this is an issue on all three.
master: 481d52238f5c4cf0b4e0a77fbb7bcc2aff2e8645
v20.11.80
v20.08.1

I'm using qalc version 3.15.0
Comment 1 Nikita Sirgienko 2020-12-06 22:26:59 UTC
Git commit 9556b69fc03350eb88f5a3f2ef21e6853b058cf3 by Nikita Sirgienko.
Committed on 06/12/2020 at 22:25.
Pushed by sirgienko into branch 'master'.

[Qalculate] Fix bug with terminal colour symobls in command results
FIXED-IN: 20.12.1

M  +1    -1    CMakeLists.txt
M  +2    -0    cmake/FindQalculate.cmake
M  +3    -0    src/backends/qalculate/CMakeLists.txt
M  +5    -0    src/backends/qalculate/qalculatesession.cpp

https://invent.kde.org/education/cantor/commit/9556b69fc03350eb88f5a3f2ef21e6853b058cf3