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

Bash/Linux: terminal rows and columns are not read properly by default #7295

Closed
kmsquire opened this issue Jun 17, 2014 · 6 comments
Closed
Labels
stdlib:REPL Julia's REPL (Read Eval Print Loop)

Comments

@kmsquire
Copy link
Member

In Bash, Julia always starts now assuming that I have 25 rows and 80 columns. This wasn't always the case, although I'm not sure yet when the change happened.

tty_rows() and tty_cols() determine rows and columns by reading the LINES and COLUMNS environment variables. However, these variables are shell variables in bash, and are not set as environment variables by default. (See: http:https://mywiki.wooledge.org/BashFAQ/091)

Related: #4513

@kmsquire
Copy link
Member Author

Well, maybe I'm wrong and this never worked, and the systems I was on set LINES and COLUMNS as environment variables. I see the same behavior on Julia 0.2.1.

@kmsquire kmsquire changed the title Bash/Linux: terminal rows and columns are no longer read properly. Bash/Linux: terminal rows and columns are not read properly by default Jun 17, 2014
@kmsquire
Copy link
Member Author

I take that back. Running ./julia -e 'println(Base.tty_rows(), " ", Base.tty_cols())' from the command line always shows 25 80, but interactively, the proper values used to be set (and are no longer).

@staticfloat
Copy link
Sponsor Member

I too see this on OSX, even with things like shopt -s checkwinsize enabled.

@ihnorton ihnorton added the REPL label Jun 17, 2014
@kmsquire
Copy link
Member Author

I'm git bisecting right now.

@simonster
Copy link
Member

I think readline used to read the terminal size on startup, even though we broke updating the size on terminal resize at some point. It looks like Terminals actually has a function that calls libuv to get the TTY size (check size(Base.active_repl.t)) but we don't currently call it on startup. I'll play around with it.

simonster added a commit that referenced this issue Jun 17, 2014
@kmsquire
Copy link
Member Author

Thanks, Simon. FWIW, it was the introduction of the new REPL where this was lost, which makes perfect sense.

simonster added a commit that referenced this issue Jun 17, 2014
Replaces tty_rows()/tty_cols() with tty_size(), which calls
uv_tty_get_winsize() to get the terminal size
simonster added a commit that referenced this issue Jun 17, 2014
Replaces tty_rows()/tty_cols() with tty_size(), which calls
uv_tty_get_winsize() to get the terminal size
simonster added a commit that referenced this issue Jun 17, 2014
Replaces tty_rows()/tty_cols() with tty_size(), which calls
uv_tty_get_winsize() to get the terminal size
simonster added a commit that referenced this issue Jun 18, 2014
RFC: Use real terminal size for show (fix #7295 and #4513)
mauro3 pushed a commit to mauro3/julia that referenced this issue Jun 19, 2014
Replaces tty_rows()/tty_cols() with tty_size(), which calls
uv_tty_get_winsize() to get the terminal size
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib:REPL Julia's REPL (Read Eval Print Loop)
Projects
None yet
Development

No branches or pull requests

4 participants