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

API to control whether raw mode, input, etc. are used on creation #496

Open
JakeWharton opened this issue Oct 15, 2024 · 3 comments
Open
Labels
enhancement New feature or request mosaic/runtime

Comments

@JakeWharton
Copy link
Owner

Right now it's unconditional

@JakeWharton JakeWharton added enhancement New feature or request mosaic/runtime labels Oct 15, 2024
@takahirom
Copy link

I'm developing a CLI library using Mosaic. It works great, but when I run Mosaic in CI environments like GitHub Actions, I encounter the error "Cannot enter raw mode on a non-interactive terminal". We can work around this by setting an environment variable:

env:
  MOSAIC_RAW_MODE: false

Mosaic uses System.getenv to retrieve this variable, which prevents programmatic updates. Consequently, I'm forced to ask users to configure it manually(I would like to observe values in Compose). If we could switch to using System.getProperty(), we could modify it using setProperty. However, this is a Java-only API, so ideally, it would be beneficial to have a more platform-agnostic API for this. I'm hoping we can make suspend fun runMosaic(enterRawMode: Boolean, content: @Composable () -> Unit) public.

@JakeWharton
Copy link
Owner Author

By CLI library do you mean a library that other CLI apps will consume? I'm curious what API surface you expose for rendering within a host application.

@takahirom
Copy link

Sorry, "CLI library" was miss leading. It's a just a CLI tool. 
I was able to workaround this problem by using internal function.
https://github.com/takahirom/arbigent/pull/63/files#diff-0ab06ac1952f748ca89c44c47f48f75f2eab65a8e96693749b99c1ec7a2e2101R36

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request mosaic/runtime
Projects
None yet
Development

No branches or pull requests

2 participants