In addition to Idan answer, I want to add that alias precmd 'history -S; history -M' potentially can mess up the history file, since it also records SIGINT and EOF signal (Ctrl+C and Ctrl+D).
A better way would be save and merge current shell history beforeafter running a command, and save after a comment.
You can achieve it by this setup below instead, becausesince the tcsh doesn't recognize SIGINT or EOF as a valid command.
alias precmd postcmd "history -M"
alias postcmd S; "historyhistory -S"M"
