Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#15900 - [filesystem] export COLUMNS LINES in /etc/profile should probably be removed?

Attached to Project: Arch Linux
Opened by Anders Bergh (anders) - Tuesday, 11 August 2009, 12:47 GMT
Last edited by Aaron Griffin (phrakture) - Wednesday, 12 August 2009, 15:41 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Tobias Powalowski (tpowa)
Aaron Griffin (phrakture)
Thomas Bächler (brain0)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

nano (and probably other apps as well) in PuTTY becomes garbled when you resize the window. Commenting out "export COLUMNS LINES" in /etc/profile solves it.

Additional info:

* package version(s)

filesystem 2009.01-2
nano 2.0.9-2

Steps to reproduce:

Install PuTTY, log in and run nano. Resize the window a bit. Screen will become garbled.
This task depends upon

Closed by  Aaron Griffin (phrakture)
Wednesday, 12 August 2009, 15:41 GMT
Reason for closing:  Not a bug
Additional comments about closing:  We are all crazy :)
Comment by Thomas Bächler (brain0) - Tuesday, 11 August 2009, 14:38 GMT
With my terminal emulators (yakuake, rxvt-unicode), the values of COLUMNS and LINES change whenever I resize the window. This is the same when I run the gtk-Version of putty on Linux. Can you run "echo $COLUMNS $LINES" in a shell, then resize the window and run them again?
Comment by Anders Bergh (anders) - Tuesday, 11 August 2009, 16:25 GMT
Yes, they do change when I change my window.

$ echo $COLUMNS $LINES
78 36
$ echo $COLUMNS $LINES
78 43
Comment by Aaron Griffin (phrakture) - Tuesday, 11 August 2009, 16:30 GMT
Hmm this doesn't seem like the proper fix to me. nano *should* have SIGWINCH handlers to resize itself.

COLUMNS and LINES should be exported in most terminals anyway, the reason they are in /etc/profile is more of a "just in case" situation
Comment by Aaron Griffin (phrakture) - Tuesday, 11 August 2009, 16:31 GMT
Usually things like this happen when your $TERM isn't set right. What is the value of $TERM you are using?
Comment by Anders Bergh (anders) - Tuesday, 11 August 2009, 18:10 GMT
It's set to xterm, which should be correct (it's what PuTTY is emulating)
Comment by Anders Bergh (anders) - Tuesday, 11 August 2009, 18:13 GMT
By the way, here's where I found the suggestion to remove the exports:

http://bbs.archlinux.org/viewtopic.php?id=29747

Last post in that thread. The application affected was weechat.
Comment by Aaron Griffin (phrakture) - Tuesday, 11 August 2009, 18:46 GMT
Weird... ok if this does cause problems in some apps, can you please make sure that removing these doesn't break anything? Testing should include:
zsh, bash, (other shells)
xterm, urxvt, (other terminals)
wget type output (where it rewrites the same line. pacman does this too)
curses apps
ls / resize / ls (to ensure columnar changes are picked up)
Comment by Jan de Groot (JGC) - Tuesday, 11 August 2009, 21:15 GMT
When I resize a terminal while vim is open, the COLUMNS environment variable doesn't get updated and everything is confused after closing vim. This is with gnome-terminal and bash.
Comment by Aaron Griffin (phrakture) - Tuesday, 11 August 2009, 21:26 GMT
And when COLUMNS is unset? Does it work fine?

Using Terminal.app on OSX (ssh'd into gerolde) works fine, COLUMNS is set properly before, during, and after running vim.

Does gnome-terminal handle SIGWINCH?
Comment by Jan de Groot (JGC) - Tuesday, 11 August 2009, 21:29 GMT
gnome-terminal (vte actually) doesn't update COLUMNS at all while vim is running. Neither does it when I unset COLUMNS first.
Comment by Anders Bergh (anders) - Tuesday, 11 August 2009, 23:16 GMT
Without COLUMNS exported, COLUMNS is updated while nano is running.

With COLUMNS exported, COLUMNS is not updated at all while nano is running.

(again, with PuTTY on windows)
Comment by Aaron Griffin (phrakture) - Tuesday, 11 August 2009, 23:34 GMT
From the POSIX standard:
---
COLUMNS
This variable shall represent a decimal integer >0 used to indicate the user's preferred width in column positions for the terminal screen or window; see Column Position. If this variable is unset or null, the implementation determines the number of columns, appropriate for the terminal or window, in an unspecified manner. When COLUMNS is set, any terminal-width information implied by TERM is overridden. Users and conforming applications should not set COLUMNS unless they wish to override the system selection and produce output unrelated to the terminal characteristics.

Users should not need to set this variable in the environment unless there is a specific reason to override the implementation's default behavior, such as to display data in an area arbitrarily smaller than the terminal or window.
---

Interesting. Looks like we should kill it off

EDIT: There is a similar comment for LINES
Comment by Aaron Griffin (phrakture) - Tuesday, 11 August 2009, 23:38 GMT
Ummmm... LINES and COLUMNS have not been set in /etc/profile since profile was moved to the filesystem package

LOL
Comment by Anders Bergh (anders) - Wednesday, 12 August 2009, 08:34 GMT
lmao

well, that's odd. I don't have a /etc/profile.pacnew otherwise I might have noticed (with 2009.07-1). But I guess this could be closed now then.. thanks for your help :)

Loading...