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

Feature Suggestion: Output Handler #729

Open
yschimke opened this issue Jun 16, 2019 · 5 comments
Open

Feature Suggestion: Output Handler #729

yschimke opened this issue Jun 16, 2019 · 5 comments

Comments

@yschimke
Copy link

Some code from my own libraries that could be useful if you want richer terminal integration.

Launching preview apps

https://github.com/yschimke/oksocial-output/blob/master/src/main/kotlin/com/baulsupp/oksocial/output/OsxOutputHandler.kt

Json pretty printing

https://github.com/yschimke/oksocial-output/blob/master/src/main/kotlin/com/baulsupp/oksocial/output/ConsoleHandler.kt

Image support (e.g. iTerm2)

https://github.com/yschimke/oksocial-output/blob/master/src/main/kotlin/com/baulsupp/oksocial/output/iterm/ItermOutputHandler.kt

@yschimke
Copy link
Author

I'm mainly suggesting this as this is code I've built myself but used in multiple apps. Definitely one to close if it's not useful, but for various CLIs being able to have an API to show output to users and use the highest fidelity representation.

@yschimke
Copy link
Author

Example output in iTerm

src/test/kotlin/commands/tweetsearch.kts Pusheen

image

@yschimke
Copy link
Author

src/test/kotlin/commands/uberprices.kts Buckingham Palace

image

@yschimke
Copy link
Author

image

@remkop
Copy link
Owner

remkop commented Jun 16, 2019

All of these look very cool!
I need some time to look into this in more detail.
(Reminds me a bit of Windows Terminal microsoft/terminal#448, that also opens some exciting possibilities.)
Definitely interested in providing tight integration with advanced shells.

iTerm inline images: https://www.iterm2.com/documentation-images.html (also implemented by MinTTY)

Further reading:

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

No branches or pull requests

2 participants