zsh-users
 help / color / mirror / code / Atom feed
From: Mario Signorino <mario@gnufish.net>
To: zsh-users@zsh.org
Subject: How to capture the tab completion result?
Date: Sun, 26 May 2013 01:27:51 +0200	[thread overview]
Message-ID: <CAM8HBcV0+VEu6ef1JbAMOChKnD=zprtiEke1=6xTOB-EK1z6TQ@mail.gmail.com> (raw)

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

Hi all

I need some help and possibly also an advice.

I want is to surround the result of the tab-completion with a special
not-printable chars.

I'm working on an application with embedded a special terminal emulator
inherited from gnome-terminal. I want to modify the common TAB behaviour
and manipulate the result of all TAB-completions: any string generated
pressing TAB should be handled by my app before going on screen.
So: the "special not printable chars" would be the way to tell my terminal:
"hey... there are some tab completions for you".

In my program I will do some work on the completion result and then I will
display it to the user in the terminal window (in some cases). I need to do
the job in my c++ code and there is no way to do that at shell level.

The best would be to switch on and off this features with an environment
var in order not to mess up the system in case I login with a standard
terminal. The dream would also have some difference between "file
completion" and everything else (as command option). For example:
completing an "ls /etc/ap" gives me a lot of result: I should know in my
terminal app that the results are files and which is their full path. In
this case, parsing the "ls /etc/ap" wuold be easy... but sometimes in the
command line there are many more chars...

The "surround char" is what I think is the easiest way... maybe also
putting everything in an env variable could be another valid way.
Everything should works also through an ssh connection... this means: I
cannot use any trick as piping result in a socket or anything else that
uses local resource.

I just spent three day into bash sources without any acceptable result. So,
looking for an alternative, I came on zsh.
So: can I do what I need with zsh?
One "yes!" and a general suggestion will be enough.

Tnx
Mario

             reply	other threads:[~2013-05-25 23:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-25 23:27 Mario Signorino [this message]
2013-05-26 23:10 ` Bart Schaefer
2013-05-27 16:45   ` Mario Signorino
2013-05-28  8:25     ` Bart Schaefer
2013-05-30 21:15       ` Mario Signorino
2013-05-26 11:23 Marc Chantreux

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='CAM8HBcV0+VEu6ef1JbAMOChKnD=zprtiEke1=6xTOB-EK1z6TQ@mail.gmail.com' \
    --to=mario@gnufish.net \
    --cc=zsh-users@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).