From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29543 invoked by alias); 15 Jun 2013 11:31:35 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 31475 Received: (qmail 25115 invoked from network); 15 Jun 2013 11:31:21 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,HTML_MESSAGE, MISSING_HEADERS,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at gnufish.net does not designate permitted sender hosts) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type:x-gm-message-state; bh=IGbvW+m3aD7xfLnqLaPAaiSvr5PpY+y4hGP2dK2r46A=; b=MRSMo+zclhfxMM11M53SLZZs99DMkDu+Oe+cJZz2od1lU7nW6rR1FSm7TUfM545pq5 uqNwU15vkuE2I492xy24LV6CP4ICYnoLi5nogMVkIwIqg8/cqJADdSjyQqC9PDVGfjHF bUj/0/hVsAgujbir9foefWE/NePIsmGvMiq5WnrBGm3X+fJRcfRa1C7wo3JrNIQjx21u tDcaDyC0VWCRB037rkrP+UrheMm44vSszWnhQpZ7z5J9M90SttEpHPEouYeh1OJWqKRz odD5oqprXOdgHcW5RpCNwLfRYfP/yj/8/oiWVVdcQyxj/Z5gZi+BpSuo54f6x6poBXiX 7sQA== MIME-Version: 1.0 X-Received: by 10.229.207.134 with SMTP id fy6mr2644319qcb.4.1371295872602; Sat, 15 Jun 2013 04:31:12 -0700 (PDT) In-Reply-To: <130530221023.ZM11251@torch.brasslantern.com> References: <130530221023.ZM11251@torch.brasslantern.com> Date: Sat, 15 Jun 2013 13:31:12 +0200 Message-ID: Subject: Re: Strange initial escape string From: Mario Signorino Cc: zsh-workers@zsh.org Content-Type: multipart/alternative; boundary=089e0116079e5e6e0a04df2fb3c2 X-Gm-Message-State: ALoCoQlhw9UUy9lE2uj8LvkTB2Whn8lzE5AdVIgiYE5tzDCF6Xq8jMkPwglW+vht06KPpPfAR78Y --089e0116079e5e6e0a04df2fb3c2 Content-Type: text/plain; charset=UTF-8 On Fri, May 31, 2013 at 7:10 AM, Bart Schaefer 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 --089e0116079e5e6e0a04df2fb3c2--