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

Display current args at edit prompt #37968

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

MaciejDromin
Copy link
Contributor

It fixes #37921 - point 3.
At the edit prompt it shows now current command line arguments, as shown in the screenshot below.
edit-demo

@gsmet
Copy link
Member

gsmet commented Jan 3, 2024

@maxandersen could you test that one?

@maxandersen
Copy link
Member

I tried this and it is better but still broken.

tried capture it in this recording:

2024-01-17_09-57-17.mp4

editing shows the current arg line correctly, but when I press enter it still shows "current arg: >" making me believe it is still asking for input.

But it is actually in devmode input mode as shorthand keys like d for debug etc works.

@@ -70,7 +70,13 @@ public void accept(int[] ints) {
Holder command = commands.get(key);
if (command != null) {
if (command.consoleCommand.getReadLineHandler() != null) {
QuarkusConsole.INSTANCE.doReadLine();
if (key == 'e') {
QuarkusConsole.INSTANCE.doReadLineWithPrompt("Current args: "
Copy link
Member

@maxandersen maxandersen Jan 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do you think about just having it be:

"state list">

instead of:

Current args: "state list">

just to save some characters in width?

otherwise maybe split over two lines and not use current as you can't "escape" to reuse it?

Enter new arguments (was "state list"):
>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prompt changed

Copy link
Member

@maxandersen maxandersen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good changes but behavior still broken after pressing enter.

@MaciejDromin
Copy link
Contributor Author

I tried this and it is better but still broken.
editing shows the current arg line correctly, but when I press enter it still shows "current arg: >" making me believe it is still asking for input.

But it is actually in devmode input mode as shorthand keys like d for debug etc works.

I think this might be some weird issue with different terminals, that's why I wasn't encountering this issue from your original issue:

Sometimes characters are not even shown when typing.

I am not seeing anything like this - maybe it is something related to Your terminal or OS? I checked this both in ZSH and Bash and it is fine, check the recording below:

q-issue.mp4

@MaciejDromin
Copy link
Contributor Author

Hey @maxandersen! Have you maybe had a chance to look at the video I posted? I'm checking on the status of this PR.

@maxandersen
Copy link
Member

Sorry. Missed the update. I'll check when back at my laptop.

@MaciejDromin
Copy link
Contributor Author

Hey @maxandersen, I'm checking on the status, have You seen the update?

@gsmet
Copy link
Member

gsmet commented Jun 7, 2024

@maxandersen I think we should merge this as it's better than what we had, even if it didn't fix the whole issue for you (apparently, it works for the OP so it might be environment-dependent).

WDYT?

@maxandersen
Copy link
Member

you are probably right - let me try again.

@MaciejDromin
Copy link
Contributor Author

Just wanted to let you know, that if there are still some issues with this PR which I will be able to reproduce, then I will be happy to fix them

@maxandersen
Copy link
Member

i've tried to build this pr but keeps having weird issues building.

recent one is:

ERROR] Failed to execute goal org.jetbrains.kotlin:kotlin-maven-plugin:1.9.22:test-compile (test-compile) on project arc-tests: Compilation failure: Compilation failure:
[ERROR] /Users/manderse/code/quarkusio/quarkus/independent-projects/arc/tests/src/test/kotlin/io/quarkus/arc/test/interceptors/InterceptableSuspendMethodTest.kt:[3,23] Unresolved reference: Arc
[ERROR] /Users/manderse/code/quarkusio/quarkus/independent-projects/arc/tests/src/test/kotlin/io/quarkus/arc/test/interceptors/InterceptableSuspendMethodTest.kt:[24,23] Unresolved reference: Arc
[ERROR] /Users/manderse/code/quarkusio/quarkus/independent-projects/arc/tests/src/test/kotlin/io/quarkus/arc/test/interceptors/KotlinInterceptorTest.kt:[3,23] Unresolved reference: Arc
[ERROR] /Users/manderse/code/quarkusio/quarkus/independent-projects/arc/tests/src/test/kotlin/io/quarkus/arc/test/interceptors/KotlinInterceptorTest.kt:[24,25] Unresolved reference: Arc
[ERROR] /Users/manderse/code/quarkusio/quarkus/independent-projects/arc/tests/src/test/kotlin/io/quarkus/arc/test/interceptors/NotInterceptedSuspendMethodTest.kt:[3,23] Unresolved reference: Arc
[ERROR] /Users/manderse/code/quarkusio/quarkus/independent-projects/arc/tests/src/test/kotlin/io/quarkus/arc/test/interceptors/NotInterceptedSuspendMethodTest.kt:[18,23] Unresolved reference: Arc
[ERROR] -> [Help 1]
[ERROR

don't think its this pr fault but just t ogive context why didn'tconfirm the pr yet.

@maxandersen
Copy link
Member

okey so I managed to build this when disabling cache (-Dno-build-cache=false) but i still see the issue of the line staying around.
It works just fine when I use quarkus 3.12.

so something in this PR or branch is triggering bad behaviour.

I tried using iterm2 and terminal - same result. works in 3.12 but with this PR it becomes broken.

@maxandersen
Copy link
Member

also tried plain bash (so none of my zsh customization should influence it). same problem. the prompt keeps "hanging" and even though I can do things like 's' for restart or 'w' for open browser - the terminal is not showing I can do that.

@MaciejDromin
Copy link
Contributor Author

I have just retested this, and for me still works as it is supposed to even on the different OS.
But let's start from the beginning. First I rebased my changed on the top of main to have the latest and greatest and it went without any issues.
Next I build the project executing ./mvnw -Dquickly
Moving on to testing, I have created a new project by executing quarkus create app -x picocli whoops and updating the pom with following values:

<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
<quarkus.platform.group-id>io.quarkus</quarkus.platform.group-id>
<quarkus.platform.version>999-SNAPSHOT</quarkus.platform.version>
<quarkus-plugin.version>999-SNAPSHOT</quarkus-plugin.version>

And now, using the just build CLI jar, I run this project in two different terminals (emulated by Intellij and system) and here are the results:

2024-07-24.11-16-38.mp4

@gsmet @maxandersen I'm not sure why it is happening to You, but like I said, I had no issues with building and running this change, and I tested this on different OS and shells. Maybe there are some steps that You do differently?

@cescoffier
Copy link
Member

@maxandersen What should we do about this one?

1 similar comment
@cescoffier
Copy link
Member

@maxandersen What should we do about this one?

@maxandersen
Copy link
Member

@MaciejDromin sorry for dropping ball on this one - it still fails for me so not sure how to fix it :/ maybe a shared screen/debug session would help? (sometime in the new year)

@MaciejDromin
Copy link
Contributor Author

@maxandersen Sure, sounds good. Maybe together we will be able to figure out what is happening :D
I don't have any plans yet for January so I'm up for any date, maybe except of 6th

@cescoffier
Copy link
Member

@maxandersen sounds like you will be able to debug it :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

quarkus dev broken for command mode arguments
4 participants