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

textual 0.10.0 renders a lonely "p" on the screen before entering the app #1622

Closed
kratsg opened this issue Jan 20, 2023 · 9 comments · Fixed by #1664
Closed

textual 0.10.0 renders a lonely "p" on the screen before entering the app #1622

kratsg opened this issue Jan 20, 2023 · 9 comments · Fixed by #1664

Comments

@kratsg
Copy link

kratsg commented Jan 20, 2023

textual diagnose crashes for me with

$ textual diagnose
Traceback (most recent call last):
  File "/Users/kratsg/.pyenv/versions/itkdb-browser/bin/textual", line 8, in <module>
    sys.exit(run())
  File "/Users/kratsg/.pyenv/versions/itkdb-browser/lib/python3.8/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/Users/kratsg/.pyenv/versions/itkdb-browser/lib/python3.8/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/Users/kratsg/.pyenv/versions/itkdb-browser/lib/python3.8/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/kratsg/.pyenv/versions/itkdb-browser/lib/python3.8/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/kratsg/.pyenv/versions/itkdb-browser/lib/python3.8/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/Users/kratsg/.pyenv/versions/itkdb-browser/lib/python3.8/site-packages/textual/cli/cli.py", line 139, in run_diagnose
    from textual.cli.tools.diagnose import diagnose
  File "/Users/kratsg/.pyenv/versions/itkdb-browser/lib/python3.8/site-packages/textual/cli/tools/diagnose.py", line 12, in <module>
    def _section(title: str, values: dict[str, str]) -> None:
TypeError: 'type' object is not subscriptable

I'm uploading a video (set playback speed to 0.5 or 0.75 to definitely see it)

Kapture.2023-01-19.at.16.36.11.mp4

showing what happens when I run textual colors. There's a brief moment when there's a lonely p on the 2nd line of the terminal screen before going into the app. Any ideas what this is? I thought it was a problem with my app, but it turns out that this doesn't show up on 0.1.17 to 0.2.0 (I suspect it made it's way in after that?).

@github-actions
Copy link

We found the following entries in the FAQ which you may find helpful:

Feel free to close this issue if you found an answer in the FAQ. Otherwise, please give us a little time to review.

This is an automated reply, generated by FAQtory

@davep
Copy link
Contributor

davep commented Jan 20, 2023

Thanks. At first glance the diagnose crash looks like some of the type annotations and Python 3.8 not getting along. Should be a simple fix.

davep added a commit to davep/textual that referenced this issue Jan 20, 2023
I mean, I guess flat out crashing on older versions of Python is *a* way of
reporting the Python version. Kinda?

See the side issue reported in Textualize#1622.
@davep
Copy link
Contributor

davep commented Jan 20, 2023

As for the "lonely p": that looks very similar to #1390 -- curiously I thought there was a bit more conversation about this somewhere but I can't find it in discussions, issues or even on the Discord server.

Could you give some more details about your environment? OS, terminal, that sort of thing?

@kratsg
Copy link
Author

kratsg commented Jan 20, 2023

new version released (thanks @davep @willmcgugan for being responsive... and I need to be better at github social media as I found out about the new version through twitter lol)

Textual Diagnostics

Versions

Name Value
Textual 0.10.1
Rich 13.2.0

Python

Name Value
Version 3.8.6
Implementation CPython
Compiler Clang 10.0.1 (clang-1001.0.46.4)
Executable /Users/kratsg/.pyenv/versions/itkdb-browser/bin/python

Operating System

Name Value
System Darwin
Release 22.1.0
Version Darwin Kernel Version 22.1.0: Sun Oct 9 20:14:54 PDT 2022; root:xnu-8792.41.9~2/RELEASE_X86_64

Terminal

Name Value
Terminal Application Apple_Terminal (447)
TERM xterm-256color
COLORTERM Not set
FORCE_COLOR Not set
NO_COLOR Not set

Rich Console options

Name Value
size width=119, height=61
legacy_windows False
min_width 1
max_width 119
is_terminal True
encoding utf-8
max_height 61
justify None
overflow None
no_wrap False
highlight None
markup None
height None

@davep
Copy link
Contributor

davep commented Jan 20, 2023

Generally the default macOS terminal isn't a great experience. See the "Your Platform" box at https://textual.textualize.io/getting_started/

@kratsg
Copy link
Author

kratsg commented Jan 20, 2023

Generally the default macOS terminal isn't a great experience. See the "Your Platform" box at https://textual.textualize.io/getting_started/

Can confirm it seems fine in iTerm 2.

@davep
Copy link
Contributor

davep commented Jan 21, 2023

Checking here with Terminal vs iTerm, I'm seeing it too. Seems likely to me that this is a variation on #1390.

@willmcgugan
Copy link
Collaborator

The "p" is part of an escape sequence which asks the terminal if the synchronisation protocol is supported. The terminal should ignore the entire sequence so you should see nothing on the terminal. Clearly macOS terminal isn't aware of this. Only fix that comes to mind is to add an exception for the mac terminal.

@github-actions
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
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants