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

A macOS Terminal mode #2658

Closed
willmcgugan opened this issue May 25, 2023 · 11 comments
Closed

A macOS Terminal mode #2658

willmcgugan opened this issue May 25, 2023 · 11 comments
Labels
enhancement New feature or request Task

Comments

@willmcgugan
Copy link
Collaborator

macOS terminal doesn't render Textual apps well. It does a poor job of borders. I think we should consider a macOS terminal mode which override border choices to make it look better on macOS.

@davep davep added enhancement New feature or request Task labels May 28, 2023
@viega
Copy link

viega commented Jun 2, 2023

Agreed on this; lots of people don't install more capable terminals.

@NfNitLoop
Copy link

+1 to this. My context:

I'm investigating Textual to use for a project. I'd like to propose using it. But if the out-of-the-box experience on Terminal.app is as it is today, it's not a great look for our product. Telling users to configure fonts and font spacing in Terminal.app, or install a different terminal to use our product is not something we want to take on. I'll probably be recommending a much simpler prompt-based UI instead of Textual as a result.

@willmcgugan
Copy link
Collaborator Author

@NfNitLoop What rendering issue in particular is a problem for you with Terminal.app?

@NfNitLoop
Copy link

Just the same sort of thing mentioned in the link from my comment.

ex: img

In particular, border styles are a bit odd. I think the top/bottom borders are misaligned w.r.t. the background they're drawn in? It looks worse when there are multiple on screen.
Screenshot 2023-06-20 at 10 04 28 AM


As an example of what I'd expect, in python_toolkit, they show this:

img2

Which in Terminal.app gets simplified to this (delta some themes, I think):

Screenshot 2023-06-20 at 10 06 31 AM

Their dialogs also use simpler rendering.

@willmcgugan
Copy link
Collaborator Author

Textual supports two border styles that allows for a different background color inside and outside of the border. These are the "tall" and "wide" border styles. Textual also supports a number of other border styles, including those used by prompt toolkit.

We are considering a macOS mode that replaces these styles with a classic style, but then that reduces the experience for those who are prepared to do the 10 second fix.

If you don't like how the "tall" and "wide" styles are rendered in Textual.app, the obvious solution would be to not use them. Run textual borders to see the other choices. It is trivial to replace the border styles for the builtin widgets.

@NfNitLoop
Copy link

It is trivial to replace the border styles for the builtin widgets.

How is that done? For every widget I use, I need to add a style to choose a different border type? Or can I do it in one setting?

We are considering a macOS mode that replaces these styles with a classic style

That would be my preference. I don't want to specify Button { border-style: dashed; } (or whatever the correct style is). Tall/wide styles do look good if they're rendered by a terminal properly. But I'd rather avoid them on broken terminals1.

But if I/textual can determine that I'm running in Terminal.app (and, possibly: the user hasn't explicitly opted out), being able to say something like app.border_downgrade(["tall", "wide"], to="ascii") as an easy global fix-up would be handy.

Footnotes

  1. Speaking of which… is there a way to open a bug against Terminal.app w.r.t. this rendering? It does seem to break the point of some of those characters.

@TomJGooding
Copy link
Contributor

Should Textual also consider a Windows Console Host mode? What about modes for embedded terminal emulators in IDEs such as PyCharm? And maybe modes for online services like Replit?

Personally I would rather Textual continues its impressive rollout of new features, rather than spending time trying to account for the deficiencies of certain terminal emulators.

@viega
Copy link

viega commented Jun 20, 2023 via email

@davep
Copy link
Contributor

davep commented Aug 10, 2023

See also #3086.

@rodrigogiraoserrao rodrigogiraoserrao removed their assignment Aug 10, 2023
@willmcgugan
Copy link
Collaborator Author

Not much we can do here, but it is documented now: https://textual.textualize.io/FAQ/#why-doesnt-textual-look-good-on-macos

Copy link

Don't forget to star the repository!

Follow @textualizeio for Textual updates.

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

No branches or pull requests

6 participants