tags:

views:

26

answers:

1

Hi,

When I use emacs from a terminal (xterm-color; a putty ssh session in this case) the font color used by emacs is different from the one I use in the shell. Which is fine. BUT, after I quit emacs (or suspend it for that matter) the colors are not restored.

Is there anything I can do to restore my term colors when returning to the shell after my emacs session?

I have aliased my ls command to add --color option, which if I run it restores my colors if the listing shows any files with "non-default" color, but that is a rather ugly way to get my colors back.

A: 

Use a wrapper script for emacs that runs "tput reset" after emacs exits:

#!/bin/sh
emacs &
pid=$!
wait $pid
trap "kill $pid 2>/dev/null; tput reset" TERM INT EXIT
ascent1729
Thanks!This got me started. I had to modify it slightly, since my "emacs" was in turn a wrapper script to run another binary.
Kaos