1

When I execute my program and I read with either jline's ConsoleReader or with the BufferedReader the text I enter is entered but not shown. For example I type asd, my Console does not show asd, but when I hit enter, it tells me Could not find command 'asd'. Type 'help' for help So the String I enter gets read, but does not show up.

Windows command prompt, start script:

@echo off
java -jar PixelCloud.jar
pause

I've tried to put my Code in a thread, use Scanner, use BufferedReader, use ConsoleReader and none worked

        AnsiConsole.systemInstall();
        try {
            reader = new ConsoleReader(System.in, System.out);
        } catch (IOException e) {
            e.printStackTrace();
        }
        console = new ColoredConsole();
        console.sendMessage(Message.TYPE_HELP);
        String line;
        System.out.println("test");
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        while((line = reader.readLine()) != null) {
            System.out.println("test2");
            Command.dispatchCommand(line);
        }

I expect when I type asd, that asd is shown while I type it. My current console Output is

Type "help" for help.
test
test2
Could not find command 's'. Type "help" for help.
test2
Could not find command 'hello'. Type "help" for help.

1 Answers1

0

In a Windows environment, the @echo off, no prompt nor entered commands are displayed, only the output of the commands you enter;

More info at Microsoft echo command

djointster
  • 346
  • 3
  • 12
  • The ```@echo off``` just turns off the Messages of the Batch file, not the Input. I tried, even though, but did not work (sorry for my bad english) – DasBabyPixel Oct 31 '19 at 11:59