-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[bug] Missing newline character for ("on", "data") callback on js api #6388
Comments
Please provide the needed information especially the reproduction, I will reopen the issue once a reproduction is submitted. |
I have updated the issue by providing a link to a test application which showcases the error |
So this is actually the intended behavior, you get each line separately, so you can process each line as it comes, if you want to concatenate them and display them, you need to add the new line in your code. However, there is not the case on Windows and I will try to fix this to make it consistent. |
Diving deeper into this issue, I think the intended behavior should be to include |
Describe the bug
I'm experiencing an issue with the on data callback for the stdout pipeline when spawning a child process.
The child process spawned by Tauri is written in C: it prints a string which might terminate with a newline character or not, and a fflush is called right after this print.
The issue is that Tauri never includes the newline character when the on data listener is called, but I need to know if that newline character was present or not in the stdout.
Reproduction
I have prepared a Tauri application to showcase this error: https://github.com/TALCo-Team/tauri-issue-newline-stdout
In order to reproduce the error, simply build and run the test application and observe the results reported inside the main page: the stdout outputs of the executed program will be missing the expected newline characters.
You can also check the C source code and try to run the launched executable using the shell instead: you'll see that the newline characters should indeed be present.
Expected behavior
The Tauri interface should be able to report all newline characters from the stdout of its child processes, but it looks like all trailing newline characters are instead cutoff.
Platform and versions
yarn tauri dev
The test application has been run on Ubuntu 20.04 and Windows 10 using the latest available version for Tauri, the issue only seems to happen on Ubuntu 20.04.
Stack trace
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: