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

crossterm::terminal::size() returns Ok((0, 0)) in eshell #891

Open
Wilfred opened this issue May 10, 2024 · 0 comments · May be fixed by #893
Open

crossterm::terminal::size() returns Ok((0, 0)) in eshell #891

Wilfred opened this issue May 10, 2024 · 0 comments · May be fixed by #893

Comments

@Wilfred
Copy link
Contributor

Wilfred commented May 10, 2024

Describe the bug

When running inside eshell, crossterm claims the size of the terminal is zero.

A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Open eshell, the shell inside Emacs.
  2. Run a rust program that invokes crossterm::terminal::size()
  3. Observe that it returns Ok((0, 0))

Expected behavior

crossterm should respect the $COLUMNS and $ROWS shell variables, which are set.

OS
Arch Linux, kernel v6.8.2

Terminal/Console
eshell on Emacs 29.3

swilde added a commit to swilde/crossterm that referenced this issue May 17, 2024
For some terminals (for example Emacs eshell/eterm) the ioctl with
TIOCGWINSZ might falsely return 0 columns and 0 rows.  If this happens
we now try to use LINES and COLUMNS environment variables.

Fixes crossterm-rs#891
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.

1 participant