Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ErrLineBufferOverflow error when a command uses return (\r) to overwrite previous output line #67

Open
bjohnsonAPF opened this issue Sep 11, 2021 · 1 comment

Comments

@bjohnsonAPF
Copy link

Some commands use a return character at the end of each line in order to overwrite the previous output line with new data. This is often used to show progress of the running command. An example is the dc3dd command. This command outputs the progress of the command to one line that consistently gets overwritten with the new progress stats. If a long running command does this the output will continually be saved to the buffer and not passed to the go channel in the Write function of OutputStream because this function only checks for \n or \r\n at the end of a line. Because a command like this will never have a \n at the end of an output line the buffer will overflow every time the command is run.

@shicheng0829
Copy link

shicheng0829 commented Feb 9, 2023

https://github.com/shicheng0829/cmd

I met with the problem same as you. This repo may be helpful.
I change the delimiter to \n or \r.
Ignore \r\n Because \r\n only useful in Windows environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants