From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26974 invoked by alias); 25 May 2013 23:28:23 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 17812 Received: (qmail 26873 invoked from network); 25 May 2013 23:28:18 -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=-2.6 required=5.0 tests=BAYES_00,HTML_MESSAGE, RCVD_IN_DNSWL_LOW autolearn=ham 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:from:date:message-id:subject:to:content-type :x-gm-message-state; bh=RHXjwHwvefvU5F9QnxpGaICeEfoBINGfRo8zjF9WY08=; b=NVM1Qi+Uzoj67uB2l3mxAfb6BaG5ngJOgbOkPMbjnnlgHqTQ/Mt7d0gwXgIrWO/s/Z PWAjM3pZDgeSA2RHe1Qo3OEYaIrdjt1FJ86nk/IefH6bbltU6ZRHvL70RqXm3CDbDZQ2 Sucjb6e5gQE+U8uI2og1jBKc/XOUqS/Lw0RawR22/k/sEyn9VYWWNlne3z7myYlGlp6t XO0uWl2uyD8tnmRjPmFPVnY0iznt0ygFCjL4KciSui1vbNx8FbYdUMoqlmOyxkqu8NWU CKBo7DUyJ92bkSH4e+s5kDxk21rBJMiedcXzKS6s5JRAilDhwwjU+vA2VuR/Sx1thjPx 1waA== X-Received: by 10.224.126.196 with SMTP id d4mr21874588qas.57.1369524491101; Sat, 25 May 2013 16:28:11 -0700 (PDT) MIME-Version: 1.0 From: Mario Signorino Date: Sun, 26 May 2013 01:27:51 +0200 Message-ID: Subject: How to capture the tab completion result? To: zsh-users@zsh.org Content-Type: multipart/alternative; boundary=001a11c2337acdd6bf04dd9344cd X-Gm-Message-State: ALoCoQlUQjXlp1v22bL7wnjupjA78uENidkfywi2F5ZOti70H66g6pbfeJLk1bhzPrYo1cftlgne --001a11c2337acdd6bf04dd9344cd Content-Type: text/plain; charset=UTF-8 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 --001a11c2337acdd6bf04dd9344cd--