Closed si458 closed 3 weeks ago
I just tested this as I'm running MeshCentral on a Windows Server (Server 2022 VM). Under my Windows Server version it's not changing the end of lines. When I edit the file directly with Notepad++ it adds a LF. When I edit that same file in the MeshCentral WEB GUI file editor it also adds a LF when viewing the resulting edit in Notepad++
So must just be something coming from running MeshCentral under Linux?
If u use normal notepad and write something, then open it inside notepad++ u can see its CR LF
But if u then edit it in the webui. It then saves back to LF
I'm in the process of adding in the option in the Web ui in the edit to let u change the line breaks between windows/mac/linux :)
Our custom software looks for cr lf and when I edit in the ui, it's saving as lf which then goofs up our custom software haha
When u copy the data into text area it changes \r\n to just \n
Which then in turn when u save the file is using \n instead of the original \r\n
You are right, I do see that now. It removes the carriage return (CR) even under my Windows Server version.
I was going to get it default to whatever OS the remote device was running originally OR If the text file contained \r\n then just use windows
Then, I decided, no, let u the end user pick but default to windows :)
then it will just replace \n with \r\n or \n or \r
Depending on what u wanted to use!
all done! https://github.com/Ylianst/MeshCentral/commit/6fe30b7730fbdb7e4e285d91ec54b8a6fa9c5ce1
you can now specify what line break to use before saving, and it remembers in your browser/session too!
Describe the bug when editing a windows text file in the file UI, when you save it appears to be saving the new lines as linux new lines?
To Reproduce Steps to reproduce the behavior:
show end of line
)Expected behavior file should be saved as is with new lines intact
Screenshots If applicable, add screenshots to help explain your problem.
Server Software (please complete the following information):
Client Device (please complete the following information):
Remote Device (please complete the following information):
console
Tab then typeinfo
] Dean ChappellAdditional context Add any other context about the problem here.
Your config.json file