문제

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.

도움이 되었습니까?

해결책

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
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top