Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: what is the effect of a percentage sign (%) as last character on the command line



On Jan 22, 10:31am, Peter wrote:
}
} I had  in .zshrc
} 
} case $TERM in
}      (xterm*|rxvt|mrxvt)
}      print -Pn "\e]0;%n@%m: $1\a"
}      ;;
}    esac

I presume you had that somewhere interesting like inside your precmd
or preexec function?  Just having it "in .zshrc" wouldn't affect any
command except possibly the very first one.

} I take it as an exercise for 2010 to understand why the first version 
} causes the erroneous behavior (;-

Most likely there's an incomplete terminal control sequence being output
which causes the terminal to consume your input (or cover up the output).
Having the "% " in there somehow "finishes" that terminal control and
thus allows the I/O to pass normally through the shell.

You might be able to see more precisely what happened by running zsh
under "script" and then looking at the resulting typescript file.

SYNOPSIS
     script [-a] [-c COMMAND] [-f] [-q] [-t] [file]

DESCRIPTION
     Script makes a typescript of everything printed on your terminal



Messages sorted by: Reverse Date, Date, Thread, Author