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

Truncation of displayed array entries in the REPL with TERM=dumb #36492

Closed
ezaron opened this issue Jun 30, 2020 · 7 comments
Closed

Truncation of displayed array entries in the REPL with TERM=dumb #36492

ezaron opened this issue Jun 30, 2020 · 7 comments
Labels
REPL Julia's REPL (Read Eval Print Loop)

Comments

@ezaron
Copy link

ezaron commented Jun 30, 2020

Is the REPL broken in the latest stable version of Julia? In version 1.3.1 I obtained the (expected) truncation of arrays displayed in the REPL. For example, the command
randn(100,100)
displays a truncated set of values.

In Julia versions 1.4.1 and 1.4.2 the same command will attempt to display all 10000 values of this array. Of course, the situation is much worse for huge arrays.

I understand that I can suppress the output with a trailing semicolon, but I preferred the old behavior that displayed a small selection of array values.

displaysize(stdout) returns the value (24, 112), which looks correct to me.

@mbauman
Copy link
Member

mbauman commented Jun 30, 2020

Something is likely wrong with your setup. How did you install and launch Julia? What's the output of versioninfo(verbose=true)? Do you see any warnings upon startup?

@ezaron
Copy link
Author

ezaron commented Jun 30, 2020 via email

@ezaron
Copy link
Author

ezaron commented Jun 30, 2020

I can confirm that the REPL works as expected inside an emacs-term, but it is broken in this regard in an emacs-shell.

Manually changing TERM inside the emacs-shell fixes the display truncation behavior, but changes the command-line prompt to gibberish.

@mbauman
Copy link
Member

mbauman commented Jun 30, 2020

TERM=dumb

Well that would do it. You're explicitly disabling all the fancy terminal features because your emacs shell doesn't support some of them. You could potentially try julia --color=no without TERM=dumb.

@ezaron
Copy link
Author

ezaron commented Jun 30, 2020

Solved (mostly):
I think the best workaround is to use an emacs term (instead of emacs shell) in the buffer that will execute the REPL. Then, in that buffer, type C-c C-j to enter "line-mode". This basically re-enables all the nice features of shell mode, such as easy switching between buffer windows, cut-and-paste, scrolling up the screen, etc.

In any case, I will close this issue. Hopefully these notes will be useful to others who like to use emacs as their IDE for developing in julia.

@ezaron ezaron closed this as completed Jun 30, 2020
@rfourquet rfourquet added the REPL Julia's REPL (Read Eval Print Loop) label Jul 1, 2020
@StefanKarpinski
Copy link
Member

displaysize(stdout) returns the value (24, 112), which looks correct to me.

This indicates that the problem is that displaysize() is not being followed. Did something change where displaysize() is not respected in dumb terminal mode?

@mbauman mbauman changed the title Truncation of displayed array entries in the REPL Truncation of displayed array entries in the REPL with TERM=dumb Jul 10, 2020
@ezaron
Copy link
Author

ezaron commented Jul 10, 2020

Thanks for your attention to this.

mbauman added a commit that referenced this issue Jul 13, 2020
fix #36492, ensure output is limited even with basic REPLs
JeffBezanson pushed a commit that referenced this issue Jul 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
REPL Julia's REPL (Read Eval Print Loop)
Projects
None yet
Development

No branches or pull requests

4 participants