Multiline support in Terraform console
Terraform Version
Any/latest
Use Cases
I would like to be able to post multiple lines into terraform console. While the console as it is is very useful, there are circumstances where being able to cut-and-paste more syntactically valid yet complex code is precluded by this limitation. See also https://discuss.hashicorp.com/t/multiline-expression-in-terraform-console/23452
Attempted Solutions
N/A
Proposal
Please include multiline support in terraform console. :)
References
No response
Thanks for this feature request! If you are viewing this issue and would like to indicate your interest, please use the 👍 reaction on the issue description to upvote this issue. We also welcome additional use case descriptions. Thanks again!
Joining in as well. Our use case is developing deeply nested for expressions.
there are workarounds to overcome the limitation of not just pasting multiline expressions to the console, but it would be a big benefit for developer exeperience if those workarounds would not be needed! +1
"tab" completion would be nice too
Whilst we are at history like shell history please ;-)
Not rocket science :)
Hi all,
I worked on this in https://github.com/hashicorp/terraform/pull/34822 without realizing this issue was open for it.
My initial implementation was focused on making it possible to paste in multi-line expressions, since that was relatively easy to achieve without totally rewriting the console input to use a multiline-capable readline library. I hope that in future it'll be extended to support multiline editing too, but if I'd chosen that scope then it would've been far too big an effort to do anything at all, so this is a compromise to deal with what seems to be the main case.
The original request in this issue was also about pasting, so I'm going to consider this issue to be "done" now that change is merged.
I see some other folks making other unrelated suggestions about the console, like persisted history and tab completion. Those are not in scope for this issue but are already covered by https://github.com/hashicorp/terraform/issues/27370 and https://github.com/hashicorp/terraform/issues/27369, so please follow (and potentially vote on) those issues if you are interested in those additional capabilities.
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.