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

Correct terminal width does not seem to be properly forwarded to child processes #146

Open
Hubro opened this issue Jan 25, 2023 · 3 comments

Comments

@Hubro
Copy link

Hubro commented Jan 25, 2023

I'm using Python's Rich library to show log output while I'm developing. This library uses the terminal width to place certain information at the very right edge of the screen.

This works great, even in tmux, but when launched through overmind or hivemind:

image

I tried exporting COLUMNS to the correct value for my current terminal, just to see what would happen:

image

This value seems to be picked up by Rich, since running the command directly still works, and the Python command in hivemind now thinks it has 123 columns to work with even though hivemind itself eats some of those. It has no effect when running the command using overmind.

It seems like the terminal size isn't being correctly forwarded to the Python process.

Should this be working? If yes, how can I troubleshoot this further?


I'm using kitty 0.26.5, $TERM is set to xterm-kitty. I also tested with xfce4-terminal with $TERM set to xterm-256color and the result was identical.


Example Python application to reproduce the problem:

pyproject.toml:

[tool.poetry]
name = "test"
version = "0.1.0"
description = ""
authors = ["Your Name <you@example.com>"]
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.10"
rich = "^13.2.0"


[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

test.py:

import logging
from rich.logging import RichHandler

FORMAT = "%(message)s"
logging.basicConfig(
    level="NOTSET", format=FORMAT, datefmt="[%X]", handlers=[RichHandler()]
)

log = logging.getLogger("test")
log.info("Hello, World!")

Procfile:

test: poetry run python test.py
@DarthSim
Copy link
Owner

Wow, this is a nice description! Thanks!
v2.4.0 sets the proper size for tmux windows

@Hubro
Copy link
Author

Hubro commented Jan 27, 2023

Wow, this is a nice description! Thanks! v2.4.0 sets the proper size for tmux windows

Awesome 🎉 overmind 2.4.0 fixed the issue!

image

Is a similar fix possible for Hivemind? 🙂

@DarthSim
Copy link
Owner

DarthSim commented Feb 6, 2023

I'd not say it's impossible, yet it's much more complex

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