From owner-freebsd-questions@FreeBSD.ORG Wed Sep 3 14:48:41 2014 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1F0B1E88 for ; Wed, 3 Sep 2014 14:48:41 +0000 (UTC) Received: from relay2.tomsk.ru (mail.sibptus.tomsk.ru [212.73.124.5]) by mx1.freebsd.org (Postfix) with ESMTP id 80C241370 for ; Wed, 3 Sep 2014 14:48:40 +0000 (UTC) X-Virus-Scanned: by clamd daemon 0.98.1 for FreeBSD at relay2.tomsk.ru Received: from admin.sibptus.tomsk.ru (account sudakov@sibptus.tomsk.ru [212.73.125.240] verified) by relay2.tomsk.ru (CommuniGate Pro SMTP 5.1.16) with ESMTPSA id 36597617 for freebsd-questions@freebsd.org; Wed, 03 Sep 2014 21:48:37 +0700 Received: from admin.sibptus.tomsk.ru (sudakov@localhost [127.0.0.1]) by admin.sibptus.tomsk.ru (8.14.9/8.14.7) with ESMTP id s83EmaXa014689 for ; Wed, 3 Sep 2014 21:48:37 +0700 (NOVT) (envelope-from vas@mpeks.tomsk.su) Received: (from sudakov@localhost) by admin.sibptus.tomsk.ru (8.14.9/8.14.7/Submit) id s83Ema4k014688 for freebsd-questions@freebsd.org; Wed, 3 Sep 2014 21:48:36 +0700 (NOVT) (envelope-from vas@mpeks.tomsk.su) X-Authentication-Warning: admin.sibptus.tomsk.ru: sudakov set sender to vas@mpeks.tomsk.su using -f Date: Wed, 3 Sep 2014 21:48:36 +0700 From: Victor Sudakov To: freebsd-questions@freebsd.org Subject: Re: xterm, screen and the "Home" and "End" keys Message-ID: <20140903144836.GA14568@admin.sibptus.tomsk.ru> References: <20140902132318.GA86135@admin.sibptus.tomsk.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140902132318.GA86135@admin.sibptus.tomsk.ru> Organization: AO "Svyaztransneft", SibPTUS X-PGP-Key: http://www.dreamwidth.org/pubkey?user=victor_sudakov X-PGP-Fingerprint: 10E3 1171 1273 E007 C2E9 3532 0DA4 F259 9B5E C634 User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2014 14:48:41 -0000 Victor Sudakov wrote: > > Could you please help me solve the problem with screen or xterm? > > From a FreeBSD 9.3 xterm I ssh to a remote host. The "Home" key sends > (and the remote application receives) "0x1B 0x5B 0x48" (ESC [ H) > which is correct. > > However, if I start screen on the remote host, the application within > the screen's virtual terminal receives "0x1B 0x4F 0x48" for "Home" > which is "ESC O H". It results im the "Home" and key not working > correctly in vim etc. > > The "End" key has the same problem. > I think I have solved the problem by redefining what xterm is sending. In ~/.Xresources XTerm*VT100.translations: #override \n\ Home: string(0x1b) string("[1~") \n \ End: string(0x1b) string("[4~") \n Rather ugly, isn't it. -- Victor Sudakov, VAS4-RIPE, VAS47-RIPN sip:sudakov@sibptus.tomsk.ru