bash - returning from vim

Hello dear community,

I am new to BSD, have been moving from Linux to FreeBSD some months ago and since then I got some really nice experiences, but there are still some little problems, as one I have with bash (4.0).

In Linux, when I exit (e.g.) vim, it returns to the same shell prompt I had before starting vim, but in FreeBSD the output from vim remains after exit and returning to the prompt. I googled a lot about this case, but found nothing, so I would be very grateful if you could give me some useful hints.

With kind regards,
Wolf
 
You just described my most annoying Linux experience ever ;) I hate information disappearing from my screen!
 
Forgot to mention, you'll have to rebind your quit command to a function I'm afraid. I can't find an easy way to have vim execute a command on exit.
 
It's not a 'problem' with terminal emulation, it's the default behavior on FreeBSD. The same will happen when you exit any other editor, or more/less, or screen.
 
DutchDaemon said:
It's not a 'problem' with terminal emulation, it's the default behavior on FreeBSD. The same will happen when you exit any other editor, or more/less, or screen.

That's it. But is it possible to set a linux-like behavior?

Thank you anyway for your tips, vorbote.
 
Wolfram said:
That's it. But is it possible to set a linux-like behavior?

Thank you anyway for your tips, vorbote.

You can always fix the termcap/terminfo definitions for your local account. Grab a copy of the termcap database, edit it and place it in your home directory as $HOME/.termcap. If it isn't loaded automatically, add a TERMCAP variable to your environment pointing to that file.

For terminfo entries, Thomas E. D1ckey keeps the master copy at his website.
 
Thank you guys!

I tried a lot of things and variations (with te/ti in the .termcap file), but it still does not work.
What exactly has to be mentioned in $HOME/.termcap to achieve this feature?
 
I got the solution!

The original xterm-section in /usr/share/misc/termcap should be like this:

Code:
xterm|xterm-color|X11 terminal emulator:\
       :ti@:te@:tc=xterm-xfree86:

replace (or comment out) it with this:

Code:
xterm|xterm-color|X11 terminal emulator:\
        :te=\E[2J\E[?47l\E8:ti=\E7\E[?47h::tc=xterm-xfree86:

After that rebuild the termcap-database (termcap.db) with:

Code:
cap_mkdb /usr/share/misc/termcap

That's it! ;)
 
Back
Top