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

Dev mode captures console input destined to the application #23217

Closed
PierreBtz opened this issue Jan 26, 2022 · 0 comments · Fixed by #23298
Closed

Dev mode captures console input destined to the application #23217

PierreBtz opened this issue Jan 26, 2022 · 0 comments · Fixed by #23298
Labels
area/devmode kind/bug Something isn't working
Milestone

Comments

@PierreBtz
Copy link

PierreBtz commented Jan 26, 2022

Describe the bug

Running an interactive CLI (Quarkus command mode) in Quarkus dev mode (mvn quarkus:dev), Quarkus dev mode partially captures the keystrokes.

Expected behavior

I would expect the dev mode to capture the keystrokes only if the application didn't consume them before. Or if this is not possible, then I would expect a way to configure a modifier key to access the dev mode shortcuts, and the application to get everything when the modifier key is not pressed.

Actual behavior

The pattern I found is that:

  • for an input that is part of the dev mode shortcuts (eg h): the keystroke is captured by the dev mode and doesn't go to the application
  • for an input that is not part of those shortcuts (eg m): the keystroke goes once to the application and is lost once (so if I type m twice, it appears only once for the application).

How to Reproduce?

Please find a reproducer in https://github.com/PierreBtz/quarkus-termio-bug.

Steps to reproduce:

  • Build the project (mvn package).
  • Verify that it works properly with the uber-jar, you have two commands:
    java -jar target/quarkus-textio-bug-1.0.0-SNAPSHOT-runner.jar textio and
    java -jar target/quarkus-textio-bug-1.0.0-SNAPSHOT-runner.jar reader reading an input from Console and displaying it.
    One command uses a basic InputStreamReader, the other TextIO (which is
    how I noticed the problem initially...).
  • You can also verify it works with a native executable.
  • Run mvn quarkus:dev -Dquarkus.args="textio" and observe how part of the inputs are captured by the Quarkus dev mode.

Output of uname -a or ver

Darwin Pierres-MacBook-Pro-2.local 21.2.0 Darwin Kernel Version 21.2.0: Sun Nov 28 20:28:41 PST 2021; root:xnu-8019.61.5~1/RELEASE_ARM64_T6000 x86_64

Output of java -version

openjdk version "11.0.13" 2021-10-19 LTS OpenJDK Runtime Environment Zulu11.52+13-CA (build 11.0.13+8-LTS) OpenJDK 64-Bit Server VM Zulu11.52+13-CA (build 11.0.13+8-LTS, mixed mode)

GraalVM version (if different from Java)

gu --version
GraalVM Updater 21.3.0

Quarkus version or git rev

2.6.3.Final

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.8.4 (9b656c72d54e5bacbed989b64718c159fe39b537)

Additional information

No response

@PierreBtz PierreBtz added the kind/bug Something isn't working label Jan 26, 2022
stuartwdouglas added a commit to stuartwdouglas/quarkus that referenced this issue Jan 31, 2022
stuartwdouglas added a commit to stuartwdouglas/quarkus that referenced this issue Jan 31, 2022
@quarkus-bot quarkus-bot bot added this to the 2.8 - main milestone Feb 7, 2022
@gsmet gsmet modified the milestones: 2.8 - main, 2.7.1.Final Feb 7, 2022
gsmet pushed a commit to gsmet/quarkus that referenced this issue Feb 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/devmode kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants