-   Slackware (
-   -   TERM=xterm-256color vi only show 1 line problem (

number22 12-04-2011 11:39 PM

TERM=xterm-256color vi only show 1 line problem
using slackware 64 13.37, when I switch $TERM from linux to xterm-256color, from /usr/share/terminfo/x/xter-256color, program vi only show 1 line, and will not fill up my xterm screen, how do i fix this problem.

if I switch $TERM back to linux or xterm, vi will fill and show on entire xterm screen, but they only has 8bit colors.

audriusk 12-05-2011 03:57 AM

In Slackware vi is a symlink to elvis. I don't think that elvis has 256 color support. You might want to use vim instead.

number22 10-02-2012 06:04 PM

Finally, find out what is wrong, need to tweak /etc/termcap file (version 13.37), scroll to line#144, modify/add


in between.

And, the bash prompt line will wrap properly (move cursor down for newline), vi(elvis) will work as in TERM=linux. vim will show a lot more colors.

add shopt -s checkwinsize in .bashrc will update columns and line numbers.

number22 10-05-2012 07:26 PM

Modify /etc/DIR_COLORS files; add xterm-256color term type too.

TERM xterm-256color

lopid 12-09-2012 05:11 PM

I wonder if we can have this in a future ‘etc’ Slackware package, since it affects more than just vi/elvis. For example, readline’s horizontal-scroll-mode is ignored when TERM is xterm-256color and it isn’t in /etc/termcap. Might as well add xterm+256color and the 88 colour versions, too.

My DIR_COLORS already included xterm-256color.

elyk 12-10-2012 11:46 PM

On my machine I've decided to remove the termcap package, then rebuild a few of the stock Slackware packages so they link to ncurses (which uses terminfo) instead. It seems to make most of these kinds of problems go away. One less package to install, one less thing to go wrong...

The process goes something like this:
  1. Recompile bash using --with-curses, then reinstall it (so that we can still use bash after the next few steps).
  2. Remove the libtermcap package.
  3. Rebuild aaa_elflibs without the libtermcap files, then reinstall it. libtermcap is now gone.
  4. Next we want ncurses to fill in where we removed libtermcap. Rebuild the ncurses package with a couple of modifications. Remove the part where termcap.h gets renamed to termcap-ncurses.h to avoid clobbering the one from libtermcap since this isn't necessary anymore. Add compatibility symlinks from libtermcap.{a,so} to libncurses.{a,so} (search the Slackbuild for "Olde obsolete names" where we already do something similar) so that anything trying to link to libtermcap will instead get linked to ncurses. Reinstall after rebuilding.
  5. We no longer need the termcap-{BSD,Linux} files in /etc. Rebuild the etc package without them, also without the part of that copies one of these to /etc/termcap. Reinstall after rebuilding. It's now safe to delete /etc/termcap, which is a leftover from this package.
  6. Rebuild and reinstall at least the following stock Slackware packages so they'll link to ncurses instead of libtermcap: a/bash (in case you skipped the first step, but this time --with-curses isn't strictly needed), x/xterm, a/elvis, a/tcsh, a/procps, n/gnupg, n/gnupg2, n/tftp-hpa, n/mtr, ap/jove, l/pilot-link, kde/analitza, d/ruby. I found these using "objdump -x $FILE | grep NEEDED" on all the executable and library files I could find. There may be others. You may have other non-stock packages that need to be rebuilt.

All times are GMT -5. The time now is 10:25 PM.