Emacs terminal column width (julia / python shell)

I am trying to use Emacs as an integrated computing environment for Julia and Python. ESS(Emacs Speaks Statistics) is a plugin that I use to interactively send selected code to evaluate REPL.

C-c C-cselects the code and starts the interpreter the Juliafirst time the combination is used, in subsequent executions it uses the existing session Julia.

The problem that I am facing is that the terminal window for Julia(in this case even with Python) for some reason uses only 80 columnsfor output.

For example, the following code running inside a session Juliawill print a DataFrame dfin three groups that are wrapped in 80 columns. Even though my window size can easily handle over 200 characters.

 using DataFrames
 df=readtable("../../data/titanic/data/train.csv")


 julia> df[1:2, :]
 2x12 DataFrame
 | Row | PassengerId | Survived | Pclass |
 |-----|-------------|----------|--------|
 | 1   | 1           | 0        | 3      |
 | 2   | 2           | 1        | 1      |

 | Row | Name                                                  | Sex      |
 |-----|-------------------------------------------------------|----------|
 | 1   | "Braund, Mr. Owen Harris"                             | "male"   |
 | 2   | "Cumings, Mrs. John Bradley (Florence Briggs Thayer)" | "female" |

 | Row | Age  | SibSp | Parch | Ticket      | Fare    | Cabin | Embarked |
 |-----|------|-------|-------|-------------|---------|-------|----------|
 | 1   | 22.0 | 1     | 0     | "A/5 21171" | 7.25    | NA    | "S"      |
 | 2   | 38.0 | 1     | 0     | "PC 17599"  | 71.2833 | "C85" | "C"      |

I even tried to manually start a session Juliainside the Emacs shell M-x shell, and even that would lead to 80 column wraps.

But the same code, if I execute in a session Juliarunning inside a regular one Mac OSX Terminal, correctly uses the entire width of the terminal.

Workaround / Potential Culprit

If I execute stty sizeon mine OS X Terminal, I get the correct output, which represents the actual size of my terminal, for example 24 157.

stty size Emacs M-x shell, 0 0. , Emacs stty emacs, 0 0.

stty, stty rows 24 cols 160, Julia, julia 160 .

  • Emacs stty () , .
  • # 1 , , , stty .emacs, .

Linux- (CentOS), .

.

+4
1

emacs M-x, , envvar EMACS = t, .bashrc .

, "Mx ansi-term", , , .. : https://masteringemacs.org/article/running-shells-in-emacs-overview - , ( ).

, ansi-term, M-x, .profile .bashrc. , , .

[ _"$EMACS" = _t ] && stty cols 160
+1

Source: https://habr.com/ru/post/1598948/


All Articles