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

Re: Strange initial escape string

On Fri, May 31, 2013 at 7:10 AM, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
> anything the user tells it to, so depending on what you're hoping to
> do you may be in for a hard time.
> If you're actually writing a terminal emulator, this may be helpful:
> http://www.vt100.net/emu/dec_ansi_parser

Thanks! It's clear now.
Yes: I'm actually writing a new terminal emulator... and I'm really having

This is the result so far http://goo.gl/YJgMf

I want to merge a terminal emulator, a file manager and a launcher
(zeitgeist, locate and other stuff). My app must works with no additional
software than itself. With zsh it will be fully functional: bash cannot do
half of the trick of zsh, and I did not checked know other shells. Actually
I'm writing a player for shells: I just added some custom escape codes
catch tab completion.
Each line of the terminal can be pluginable (as the launcher content) in
qml or c++: so it should be possible to add handlers for any shell
command... for example a git handler (in pure qml) should trap the git
output and display it in a different way. In the video I've done that with
That is still a prototype but it seems promising... no big problems so far.

Your link saved me a lot of work: I'm using the pre-built state machine
engine found on that link to parse the pts output. So I don't have to care
about splitting CSI and OSC... unfortunately it does not support utf8, but
I will fix it sooner or later.

Now some question:
I've used some custom escape codes ( \033| ) to surround the important
info. Now I can trap these strings and easily work on them. This is
working. The problem is in the prompt. My PS1 is something like that:

export XPIPETERMINATOR=$'\033|.'
PS1="${XPIPETERMINATOR}mario@squit $ "

that "terminator" tells to my terminal that the previous command has just
finished. I use it to close any pending operation (show icons... git fancy
output): if I receive that, it means *for sure* that I am again on the
standard prompt.
The problem is that zsh does not know anything about that escape codes and
it thinks to have written more chars than it actually has: and it sends the
carriage return too early (when I reach the end of the line).
So: how can I tell to zsh to forget those 2 or 3 special chars? Or: is
there any other way to know that the execution of the last command is just
finished? something as a "postexec()" function?


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