zsh-workers
 help / color / mirror / code / Atom feed
From: Mario Signorino <mario.signorino@gnufish.net>
Cc: zsh-workers@zsh.org
Subject: Re: Strange initial escape string
Date: Sat, 15 Jun 2013 13:31:12 +0200	[thread overview]
Message-ID: <CAM8HBcXCQ_OgEMoq_5fUDPv5NqoX-87uz8cYCUSeGnMCQFi4dw@mail.gmail.com> (raw)
In-Reply-To: <130530221023.ZM11251@torch.brasslantern.com>

[-- Attachment #1: Type: text/plain, Size: 2428 bytes --]

On Fri, May 31, 2013 at 7:10 AM, Bart Schaefer <schaefer@brasslantern.com>
wrote:
> 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
fun.

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
wget.
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?

Regards,
Mario

  reply	other threads:[~2013-06-15 11:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-30 21:28 Mario Signorino
2013-05-30 22:56 ` Mario Signorino
2013-05-31  5:10   ` Bart Schaefer
2013-06-15 11:31     ` Mario Signorino [this message]
2013-06-15 12:22       ` Mikael Magnusson
2013-06-15 18:44       ` Bart Schaefer
2013-06-15 19:14         ` Mario Signorino

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAM8HBcXCQ_OgEMoq_5fUDPv5NqoX-87uz8cYCUSeGnMCQFi4dw@mail.gmail.com \
    --to=mario.signorino@gnufish.net \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).