Skip to content

Conversation

@ekang7
Copy link
Contributor

@ekang7 ekang7 commented Oct 30, 2025

Issue #, if available:
#3271

Description of changes:
Since the triple backtick detector results in unexpected hangs, I added a multiline hint when an unclosed triple backtick is present in the user prompt. I also made it so that the hint will not be incorrectly used for autocompletion.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Copy link
Contributor

@evanliu048 evanliu048 left a comment

Choose a reason for hiding this comment

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

This is expected behavior, not a bug. When the user types ``` and presses Enter, the validator correctly treats it as an unclosed code block and returns Incomplete, moving the cursor to the next line to wait for input. I don’t currently see a strong reason to remove this check

@ekang7
Copy link
Contributor Author

ekang7 commented Nov 4, 2025

I think we may then need to update the documentation because right now
https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/command-line-chat-commands.html
doesn't include anything about triple backticks. We could also continue with the removal as users have other ways of doing multilines and sometimes if a user copies and pastes something with a single ```, this could result in unexpected behavior

@evanliu048
Copy link
Contributor

I think we may then need to update the documentation because right now https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/command-line-chat-commands.html doesn't include anything about . We could also continue with the removal as users have other ways of doing multilines and sometimes if a user copies and pastes something with a single , this could result in unexpected behavior

The documentation you pointed to covers commands, while ``` isn’t a command — it’s just a syntax check. So it’s expected that it doesn’t appear there.

That said, from a usability perspective, I agree we could improve the experience. Instead of silently waiting for the closing code fence, we might consider showing a hint when the user opens a code block — something like a clear UI indicator that Q is now in multiline mode and waiting for the closing backticks. That would avoid confusion when users forget to close the block

@ekang7
Copy link
Contributor Author

ekang7 commented Nov 5, 2025

Sounds good! I'll use the greyed out version of the hint text like in the attached screenshot to say something like "in multiline mode, waiting for closing backticks ```" when there are opening backticks but not closing backticks
Screenshot 2025-11-04 at 4 31 25 PM

@ekang7
Copy link
Contributor Author

ekang7 commented Nov 5, 2025

I have successfully added the multiline hint

@evanliu048
Copy link
Contributor

I have successfully added the multiline hint

I like the UX improvement! One concern though: pressing → (right arrow) currently fills in "in multiline mode, waiting for closing backticks ```" as input text. This seems unintended since it's a status hint, not a completion suggestion

@ekang7
Copy link
Contributor Author

ekang7 commented Nov 6, 2025

Thank you! Good point, I made it so that the hint will not be used as part of an autocompletion suggestion any longer.

@ekang7 ekang7 changed the title got rid of unnecessary triple backtick code block detector added hint for multiline triple backtick code block detector Nov 7, 2025
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

Successfully merging this pull request may close these issues.

2 participants