Emacs terminal column width (julia / python shell) -
i trying use emacs integrated computing environment julia & python. ess
(emacs speaks statistics) plugin use interactively send selected code repl evaluation.
c-c c-c
selects code , starts julia
interpreter first time combination used, in subsequent executions uses existing julia
session.
the challenge facing terminal window julia
(this case python
) reason uses 80 columns
output.
for example following code if executed inside julia
session print dataframe df
in 3 groups wrapped @ 80 columns. though window size can handle on 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 have tried manually firing julia
session inside emacs shell m-x shell
, result in 80 column wrapping.
but same code if execute in julia
session running inside regular mac osx terminal
correctly use entire width of terminal.
workaround / potential culprit
if execute stty size
on os x terminal
proper output represent actual size of terminal example 24 157
.
but if execute stty size
inside emacs shell m-x shell
0 0
. no matter size of emacs window result of stty
inside emacs 0 0
.
when manually change stty
settings, let's stty rows 24 cols 160
, execute julia
able outputs julia consume 160 columns.
question
- how can make emacs dynamically adjust stty (settings) or whatever facility give intended result.
- if #1 not possible , compromise have deal possible set static stty settings in .emacs file used default.
i have tried on linux machine (centos) , have same issue there.
thanks help.
in emacs m-x shell i'm looking at, there's envvar of emacs=t use stty settings inside of .bashrc or equivalent.
however, if use "m-x ansi-term", terminal sizing supported, including dynamic resize, serious terminal emulation, etc. more info: https://masteringemacs.org/article/running-shells-in-emacs-overview - i'd recommend path if it's possible (assuming noone knows better one).
hopefully you'll able use ansi-term, if m-x shell required, .profile or .bashrc line might work. downside per-user, , users wildly different things in scripts.
[ _"$emacs" = _t ] && stty cols 160
Comments
Post a Comment