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

Reading standard input from plugins does not work #541

Open
sdaschner opened this issue Dec 18, 2021 · 2 comments
Open

Reading standard input from plugins does not work #541

sdaschner opened this issue Dec 18, 2021 · 2 comments
Assignees

Comments

@sdaschner
Copy link

When using mvnd with a Quarkus 2.X project, the output looks different to what I'm used to with mvn.

More importantly, the keyboard input doesn't work. Is there something I need to configure?

See the two screenshots for a comparison:

mvnd (version 0.7.1-linux-amd64):

2021-12-18-150208_1920x1080_scrot

mvn:

2021-12-18-150517_1920x1080_scrot

@gnodet
Copy link
Contributor

gnodet commented Jan 10, 2022

Interactions using the keyboard are currently only supported for maven plugins which use the plexus interaction layer. The System.in input stream is currently not redefined on the daemon, also, the client does read the keyboard and perform specific tasks using the +, -, <enter>, Ctrl+L keys, and we'd have to add a mode to switch between local / remote input. It may be done automatically if we detect the daemon process is trying to read from the input stream, but that's definitely not a trivial thing to implement.

For the stream decoration (i.e., the [info][stdout] prependeded to the output), you can use the --raw-streams option which should get rid of those. Ideally, this could be configured in .mvn/mvnd.properties but this is currently only a command line option).

@gnodet gnodet changed the title Doesn't seem to work with Quarkus 2.0 dev Reading standard input from plugins does not work Jan 10, 2022
@gnodet gnodet self-assigned this Jan 11, 2022
@gnodet
Copy link
Contributor

gnodet commented Jan 12, 2022

Fwiw, quarkus uses low level terminal interactions to set up the console support, however, there's no terminal in the daemons. At the OS level, the daemon process input stream is not used at all and the output/error streams are redirected to files. Inside the JVM, the output/error are conveyed back to the client, and the input is currently not supported. Supporting redirecting input from the client to the daemon is doable, but setting up a terminal, while in theory doable, would require additional native methods not provided by jansi at the moment (such as dup2) and thus not doable right now.

gnodet added a commit to gnodet/mvnd that referenced this issue Jan 12, 2022
The implementation currently switches on the redirection when the daemon actually starts reading the System.in stream using InputStream.read() or InputStream.available().
gnodet added a commit to gnodet/mvnd that referenced this issue Dec 13, 2022
The implementation currently switches on the redirection when the daemon actually starts reading the System.in stream using InputStream.read() or InputStream.available().
gnodet added a commit that referenced this issue Dec 13, 2022
The implementation currently switches on the redirection when the daemon actually starts reading the System.in stream using InputStream.read() or InputStream.available().
gnodet added a commit that referenced this issue Jan 6, 2023
The implementation currently switches on the redirection when the daemon actually starts reading the System.in stream using InputStream.read() or InputStream.available().
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