X-Spam-Check-By: sourceware.org Message-ID: <956f9b610608121827n46e1c555j8b35dfb8239ba0c8@mail.gmail.com> Date: Sun, 13 Aug 2006 03:27:51 +0200 From: "Joe Tree" To: cygwin AT cygwin DOT com Subject: Re: cygpath as a key binding In-Reply-To: <44DE8373.3030909@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <44DE8373 DOT 3030909 AT gmail DOT com> Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com On 8/13/06, Jochen Wiedmann wrote: > Hi, > is it possible to invoke cygpath as a key binding? For example, if my > current command line is > tar c:\temp > and my cursor is on c:\temp, then it would be nice to convert c:\temp > into a Windows path by pressing a certain key. sadly it would seem that the answer is "no, except with a lot of hacking bash (or rather, readline)" relevant documentation would be the "Readline" section of man bash (readline is the library bash uses to read user input) readline DOES allow for some configuration, but it does not seem to have any option to run external commands to manipulate input, only rather primitive editing, which consists mostly of predefined key actions. a rather silly option (not very useful for you, because it only works for specific commands, and removes normal tab completion) is to set up a programmable completion (a bash feature, see man bash, builtins, complete) that calls cygpath: user AT cygwin$ complete -C "sh -c 'cygpath --dos \$2' --" justatest user AT cygwin$ justatest /etc/ user AT cygwin$ justatest F:\cygwin\etc\ (one could try to make it act like normal completion, except when it seems a path it can convert or thelike, but it doesn't seem very workable) - Joe -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/