-
Notifications
You must be signed in to change notification settings - Fork 60
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
Filter programs e.g. iconv and petcat does not work in real time with -echo #117
Comments
By default, stdout is line buffered when outputted directly to a terminal, and block buffered when redirected with a pipe. Either flushing after every line or somehow changing things to always be line buffered should work. |
|
Does expect unbuffer help? or better, use setvbuf
|
I had to install the package |
@mobluse if (echo_mode) {
int res = setvbuf(stdout, NULL, _IONBF, 0);
if (res != 0) {
printf("Cannot disable buffering\n");
exit(1);
}
} in |
One can switch on echo using POKE even though it was off when one started. #27 I believe this would not work if it's only done when initializing. Another solution would be to create a new printf() function that would always flush. One might want to filter the logs also. |
@mobluse Looking back at it, I think using Line 844 in 0d50e33
What filtering would you like to see applied? |
I would like to use iconv, petcat, awk, sed, and my own filters. I am working on something now which is currently built in to the emulator, but that could be an external filter in stead. #112 |
The current echo changes CR = \r = 0x0D to LF = \n = 0x0A. Then it's not really raw. There are also \n sent from the ROM or some other system to the echo part, i.e. before the translation of CR to LF. There are more newlines in the output on the terminal than on screen. This could be because the X16 ignores them on the screen. E.g. when starting two extra linefeeds/newlines around
The extra newlines are shown here as �. Compare this to the output screen. This should perhaps be a new issue, but it's related to echo. I discovered one place in the ROM that sends LF, see commanderx16/x16-rom#37 I think there should be several suboptions to -echo, e.g. raw, default, auto. |
The original issue is fixed, closing. |
…ches the behavior of kernal DOS) (commanderx16#117) * HostFS: support restricting wildcard matches to filetypes (better matches kernal DOS) * rename constants
I can not get filter programs to work with
x16emu -echo
. I.e. this does not work in real time, but it does work if you close the emulator:x16emu -echo | iconv --from-code=ISO8859-15 --to-code=UTF-8
x16emu -echo | petcat -c -nh
If we could get filter programs to work in real time we could show correct output in the terminal when using -echo, or better with the new suggested option -echoraw, see #135. PetCat is from VICE 3.3. IConv is included in Linux.
I tried to prevent all control characters and all 8-bit characters from printing when using -echo, but filters do still not work in real time, as they usually do in Linux.
Originally posted by @mobluse in #112 (comment)
The text was updated successfully, but these errors were encountered: