-
Notifications
You must be signed in to change notification settings - Fork 55
Escape control characters on value printing on terminal #615
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
Conversation
Introduces a feature to escape ISO control characters in console output, escaping logic in the ConsoleService. Force escape in logger, ValuePrettyPrinter and tracer methods and in the interpreter logs.
This prevents unnecessary executions triggered by pull requests.
* added tests for extending with a type from another file: one with embed as, and one with just embed (this one fails) * added some null handling in Type when calling extend, properly to be reworked * quickfix for TypeLink extend bug getOrBuildExtendedType now calls resolveTypeLinks after each time it calls buildType * changed palcement of call to resolveTypeLinks to right before calling extend, so that it catches more. * Used String.format instead of string concatenation * applied refactoring as per github review * added assertions
Modifies path resolution to correctly determine the service directory by reordering path operations.
…es (jolie#618) Bumps org.apache.commons:commons-lang3 from 3.0 to 3.18.0. --- updated-dependencies: - dependency-name: org.apache.commons:commons-lang3 dependency-version: 3.18.0 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
|
@mwallnoefer @klag @kicito This looks good but I'm a bit in doubt about introducing a stateful configuration method ( We might wanna make this more explicit though, e.g., call the operation |
This prevents two threads to set it to true after eliminating the "synchronized" construct.
|
My proposal: Do we really need the "escape" flag on the Of course this would be a breaking change against past Jolie releases and could also lead to incompatibilities. But I would need to know more about the context, @kicito. Please share it with us, otherwise it is very difficult to argue here. |
|
There was a case where the API response included special characters that caused the terminal to misbehave when Jolie printed or dumped the response to the console. This PR introduces a workaround to handle such cases. If we force escaping the special character, programs that rely on std out/in for communication might be affected by this change. It is rare nowadays (programs rely on special characters), but it is worth noting this potential side effect. @fmontesi How about Jolie prints to stderr when encountering a special character, and it is the developer's task to handle the issue themselves (or with |
|
What's the problem in adding an optional field in the request of println and print? example: type PrintRequest: string { |
|
It could break existing user code. The current behaviour of println is that
it accepts any tree and prints its root value. The subnodes are just
ignored. I suspect this feature is used extensively in existing code.
…On Mon, 4 Aug 2025, 14:41 Claudio Guidi, ***@***.***> wrote:
*klag* left a comment (jolie/jolie#615)
<#615 (comment)>
What's the problem in adding an optional field in the request of println
and print?
example:
type PrintRequest: string {
.escapeSpecialCharacters: bool // default true
}
—
Reply to this email directly, view it on GitHub
<#615 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAP3DSKSCDJQA4SRWVD7BEL3L5IHVAVCNFSM6AAAAAB7CBAXQCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTCNJQGUYTAMJQG4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
|
mmmm this is a technical debt on the declaration of println and print. They should not be: println( undefined )( void ) So, we could leave the undefined as a type, but adding a subfield escapeSpecialCharacter. WARNING: the undefined request type for println and print is deprecated. The expected type now is: |
|
I agee with @klag: The |
Deprecated since Java 16: This method was originally specified to test if a reference object has been cleared and enqueued but was never implemented to do this test.
|
That shouldn't be a big issue. What's more of an issue is that I suspect there's quite some code invoking But this should be discouraged, indeed... and I guess we should just try and check if at least everything in the A good intermediate way would be to keep |
This one throws "URISyntaxException" on illegal URIs which is way better to the factory method create() which causes a runtime "IllegalArgumentException" error (which is usually not thought to be caught at all).
|
New PR created here #635. |
Introduces a feature to escape ISO control characters in console output. Force escape for logger, ValuePrettyPrinter, and tracer methods; add escaping logic in the ConsoleService.