FS#15844 - [vi] ex-vi terminal too wide, vi starts in ex mode
Attached to Project:
Arch Linux
Opened by Henning Garus (garns) - Friday, 07 August 2009, 12:36 GMT
Last edited by Paul Mattal (paul) - Monday, 15 February 2010, 15:14 GMT
Opened by Henning Garus (garns) - Friday, 07 August 2009, 12:36 GMT
Last edited by Paul Mattal (paul) - Monday, 15 February 2010, 15:14 GMT
|
Details
Description:
On a wide console (greater 160 columns) vi reports "terminal too wide" and starts in ex mode. This can be changed by adjusting the value of TUBECOLS in config.h, as mentioned in the README. I suppose a value between 200 and 250 should be sufficient for most users. On a sidenote, the additional files du.patch and exrc.sample are missing in ABS, the patch files from nvi are still present. Additional info: vi 050325-1 Steps to reproduce: Take a terminal with a width greater than 160 chars (check $COLUMNS in bash), run vi. |
This task depends upon
Closed by Paul Mattal (paul)
Monday, 15 February 2010, 15:14 GMT
Reason for closing: Fixed
Additional comments about closing: Fixed in 050325-2.
Monday, 15 February 2010, 15:14 GMT
Reason for closing: Fixed
Additional comments about closing: Fixed in 050325-2.
and besides,
[tobias@buran scripts]$ echo $COLUMNS
224
[tobias@buran scripts]$ vi import.lua
runs just fine
TUBECOLS should stay at 160 at least since this defines
the maximum length of opening on hardcopies and allows two lines
of open on terminals like adm3's (glass tty's) where it switches
to pseudo hardcopy mode when a line gets longer than 80 characters.
Which says, unless I am totally mistaken, that it should not be set to a value less than 160.
The comment warning about changing TUBECOLS appears to be talking about ancient hardware terminals rather than about breaking the code, so I'd say it's safe to change.
Moreover, it doesn't work whenever I log in to our servers, which is very very bad. This must be fixed.
Also, the switch from nvi to ex-vi was made without any comment in subversion, it would have been nice for the reason to be archived there. Changing the severity to critical and assigning Aaron as well, as this strongly affects the core package set and our ISO.
Bumping TUBECOLS seems fine to me.
Also... when did we switch from nvi to ex-vi? Why?
I thought ex-vi replaced Vim? I put together an AUR package for ex-vi as I found the Vim package defaults to be frustrating (e.g. syntax highlighting, mouse enabled), and also felt it was too bloated for the basic text editing that I use "vi" like editors for.
d think something like 512 x 512 (1MB) or even 1024 x 1024 (2MB) would ensure it would never have to be revisited.
in the console `echo $COLUMNS` reports 175
I have a thinkpad T60,
Never say never :) I think we should look for a solution that will handle all cases, not just ones that will handle up to some large boundary. 640KiB was after all supposed to be enough for everyone :P
If your machine has more power and can run vim instead of vi, just do it! Symlink vim to vi and you are happy and still all the people who really need the small vi are happy too.
I vote for keeping it as it is.
$ COLUMNS=80 vi
and vi does't fallback to ex mode in a large terminal.
About TUBECOLS just note that 8 px is the typical font width; a 1920 px monitor gives space for 240 columns. And I don't want to think of someone with a 4 HD monitors xinerama setup.
I still don't understand the reason why this is a bug report? It is a feature request and one that should in my opinion be denied because it has no benefits but just disadvantages.
Aside from the default editor issues, I don't like using the vim package because it's defaults are not the same as vi's - I don't like syntax highlighing, and I don't like that it interprets mouse movements - I prefer the standard xterm character based application behaviour where my mouse buttons are cut-and-paste. In other words, VIM might be "vi improved", but I don't want or need any of the improvements.
Other people that have old crippled machines are (a) NOT running Arch and (b) Welcome to use another distribution that has a smaller vi if the memory footprint of vi is a deciding factor for what distro you use.
Additionally, people are ALWAYS welcome to recompile vi to suit their own needs. It is 100% impossible to cover all cases and make all people happy. The best we can do is cover the _common_ case as it does not break anything.
On a more constructive note. Yes, vi is targeted as the console editor, mainly to suffice the needs for the installer in core. For anymore serious editing vim is recommended. And contrary to other claims, vi does work out of the box, since most terminals open at sane sizes. BUT, Thomas is right, if $EDITOR is not set, most programs fall back to vi and not to vim. The environment variables are not really in our control, they shouldn't be. So whatever we open in an X-terminal might blow up, which is ugly. Fixing it with settings to 320 shall work not corrupting vi in any way. I'll get on that when I have time again.
On my over two year old i915, 1280x800 display, I get a 160 column text console by default, and it's a rather small display by today's standards.
If the current console is too big, then why doesn't the editor just use as much as it can handle and ignore the rest?
Attached is a patch and PKGBUILD diff to implement this. I increased TUBESIZE to 32000 to accommodate the new TUBEWIDTH of 320, and left TUBELINES at 100. If in the future we need to go bigger, we can always increase to keep up with screen sizes. The impact of this should be 16k vs 32k allocated when entering visual mode, and so should not affect most people.
Tobias, let me know if you would like me to apply this. I'll check back on Feb bug day if I haven't heard anything by then.
increase-tube.patch (0.4 KiB)