Escape sequences (TERM?) for Nushell errors are not handled correctly
NiceGuyIT opened this issue · comments
Server Info (please complete the following information):
- OS: Ubuntu 20.04.4 LTS
- Browser: 115.8.0esr (64-bit)
- RMM Version (as shown in top left of web UI): 0.18.0
Installation Method:
- Standard
- Standard with
--insecure
flag at install - Docker
Agent Info (please complete the following information):
- Agent version (as shown in the 'Summary' tab of the agent from web UI): Agent v2.7.0
- Agent OS: Windows 10 Pro
Describe the bug
When running a Nushell command, the output is nice. If there's an error, the escape sequences in the error are shown and the output looks horrible.
To Reproduce
Steps to reproduce the behavior:
- Go to Script Manager and create a Nushell script
- Create a Nu script that has an error. See below for an example.
- Run the script on an agent to produce an error.
- See error with escape sequences.
Note: I may be able to fix this but it will take a few months before I get to it.
Expected behavior
I expect the escape sequences to be displayed correctly and get a nicely formatted error message.
Here's the text version of the same.
Error: �[31mnu::shell::directory_not_found�[0m
�[31m�[0m Directory not found
╭─[�[36;1;4mC:\ProgramData\TacticalRMM\2779409457.nu�[0m:2:7]
�[2m1�[0m │ version
�[2m2�[0m │ ls -l sd
· �[35;1m ─┬�[0m
· �[35;1m╰── �[35;1mdirectory not found�[0m�[0m
╰────
�[36m help: �[0mC:\WINDOWS\TEMP\sd does not exist
Additional context
Here's an example Nu script.
version
ls -l sd
should probably just enable this by default
In #1026 (comment)
I had added a line to the script to make ps7 behave properly there is maybe a similar non hard config for nushell
Fancy-ANSI converts ANSI sequences to HTML. They list a couple other libraries that do the same. Might be nice in the long run.
found the solution in nushell/nushell#11847 nu need to be called with -l nushell/nushell#11847 (comment)
a pr is also coming with a script solution. nushell/nushell#11494