0

I am running a VMWare 15 Virtual Machine under Windows 10 on a laptop to create an Ubuntu 18.04.3 64-bit environment wherein the Eclipse IDE v2019-09 R (4.13.0) is set-up to create a C/C++ project that interacts with the user via the gnome-terminal. I am using Linenoise to implement a command-line interface. It uses the 'stdlib.c' function 'read()' to continuously 'poll' STDIN for characters and provide line editing. All is working fine when I run the application from within a gnome-terminal. However, when I launch my program using the Eclipse Debug View, I can see the output from the program in the console pane (STDOUT) just fine - but input from the 'console' pane is 'wonky'. After many gyrations, I have found that it CAN work if I type 31 characters (anything) 'before' the desired cli command and then hit ENTER. Clearly, Eclipse is buffering characters and only making them available to my application after '\n' (ENTER) is received (this was expected), but I don't know what's up with the 31 leading characters that are required in order for my code to 'see' the command correctly.

Is anyone familiar with this behavior and how to manage it ?

Vogy
  • 1
  • Maybe you want to [disable buffering](https://stackoverflow.com/a/16605541/5910058)? – Jesper Juhl Dec 26 '19 at 16:16
  • The read() function bypasses the Linux STDIN buffer - so it's not in the 'C' side of things - it's the Eclpse Console that is buffering. I don't see a way in the various Eclipse options to control buffering of STDIN for the application console. – Vogy Dec 26 '19 at 20:11

0 Answers0