X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=0.8 required=5.0 	tests=BAYES_20,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SARE_MSGID_LONG45,T_TO_NO_BRKTS_FREEMAIL
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
In-Reply-To: <h2s70497a8b1004071058y42def0beh1a04fe60cdc2a894@mail.gmail.com>
References: <h2s70497a8b1004071058y42def0beh1a04fe60cdc2a894@mail.gmail.com>
Date: Wed, 7 Apr 2010 21:37:49 +0100
Received: by 10.239.170.139 with SMTP id s11mr851001hbe.10.1270672669685; Wed,  	07 Apr 2010 13:37:49 -0700 (PDT)
Message-ID: <h2h416096c61004071337g6a00e829m800c2537fd7277ee@mail.gmail.com>
Subject: Re: Problem with Shift+Left or Right arrow in Cygwin locally (Ctrl  	isn't noticed) and through SSH (escape code isn't interpreted correctly)
From: Andy Koppe <andy.koppe@gmail.com>
To: cygwin@cygwin.com
Content-Type: text/plain; charset=UTF-8
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

> If I'm in Bash on my Ubuntu system I can use Ctrl+Left Arrow or Right
> Arrow to navigate one word at a time to the left and right. When I use
> Cygwin it doesn't react to the Ctrl, responding as if I only had
> pressed the Left or Right Arrow. Is there a way to fix this?

The standard Bash shortcuts for moving by a word that are Alt+f and
Alt+b, so "fix" is a bit strong here. But anyway, stick these two
lines into ~/.inputrc, restart bash, and you should be set:

"\e[1;5D": backward-word
"\e[1;5C": forward-word

And here's one way to put Ctrl+Up/Down to use:

"\e[1;5A": history-search-backward
"\e[1;5B": history-search-forward

Shift combinations have a 2 instead of the 5, in case you want to map
those to something. See this link for details on bash/readline key
bindings:

http://www.gnu.org/software/bash/manual/bashref.html#Command-Line-Editing

> The next step is when I log in from an Ubuntu 9.10 system to Cygwin 6
> using SSH.

Cygwin 6? Anyway, the above should work in this case as well, as long
as you're using an xterm-compatible terminal on Ubuntu, which you are.

> $ echo $TERM
> xterm

Andy

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

