From owner-freebsd-bugs@FreeBSD.ORG Sat Apr 2 22:20:11 2011 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A5F11065672 for ; Sat, 2 Apr 2011 22:20:11 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id BF3258FC12 for ; Sat, 2 Apr 2011 22:20:10 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p32MKAQN053492 for ; Sat, 2 Apr 2011 22:20:10 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p32MKALM053491; Sat, 2 Apr 2011 22:20:10 GMT (envelope-from gnats) Resent-Date: Sat, 2 Apr 2011 22:20:10 GMT Resent-Message-Id: <201104022220.p32MKALM053491@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Andy Kosela Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F7DC106566B for ; Sat, 2 Apr 2011 22:18:34 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id E637F8FC0A for ; Sat, 2 Apr 2011 22:18:33 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p32MIXnl084342 for ; Sat, 2 Apr 2011 22:18:33 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id p32MIXdE084341; Sat, 2 Apr 2011 22:18:33 GMT (envelope-from nobody) Message-Id: <201104022218.p32MIXdE084341@red.freebsd.org> Date: Sat, 2 Apr 2011 22:18:33 GMT From: Andy Kosela To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: kern/156137: [syscons] [patch] support for vi mode keys in scrollback history X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Apr 2011 22:20:11 -0000 >Number: 156137 >Category: kern >Synopsis: [syscons] [patch] support for vi mode keys in scrollback history >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sat Apr 02 22:20:10 UTC 2011 >Closed-Date: >Last-Modified: >Originator: Andy Kosela >Release: -CURRENT >Organization: >Environment: >Description: Some of us prefer the h-j-k-l vi mantra from traditional arrow keys. It would be very convenient to have those keys work in scrollback history buffer. I am submitting a patch to enable j-k keys for up and down, and u-d for page up and page down -- works much faster to browse the history screens now. >How-To-Repeat: >Fix: Patch attached with submission follows: Index: syscons.c =================================================================== --- syscons.c (revision 220281) +++ syscons.c (working copy) @@ -3312,6 +3312,20 @@ sc_bell(scp, bios_value.bell_pitch, BELL_DURATION); goto next_code; + case 'k': /* up key */ + sc_remove_cutmarking(scp); + if (sc_hist_up_line(scp)) + if (!(flags & SCGETC_CN)) + sc_bell(scp, bios_value.bell_pitch, BELL_DURATION); + goto next_code; + + case 'j': /* down key */ + sc_remove_cutmarking(scp); + if (sc_hist_down_line(scp)) + if (!(flags & SCGETC_CN)) + sc_bell(scp, bios_value.bell_pitch, BELL_DURATION); + goto next_code; + case SPCLKEY | FKEY | F(51): /* page up key */ sc_remove_cutmarking(scp); for (i=0; iysize; i++) @@ -3331,6 +3345,26 @@ break; } goto next_code; + + case 'u': /* page up key */ + sc_remove_cutmarking(scp); + for (i=0; iysize; i++) + if (sc_hist_up_line(scp)) { + if (!(flags & SCGETC_CN)) + sc_bell(scp, bios_value.bell_pitch, BELL_DURATION); + break; + } + goto next_code; + + case 'd': /* page down key */ + sc_remove_cutmarking(scp); + for (i=0; iysize; i++) + if (sc_hist_down_line(scp)) { + if (!(flags & SCGETC_CN)) + sc_bell(scp, bios_value.bell_pitch, BELL_DURATION); + break; + } + goto next_code; } #endif /* SC_NO_HISTORY */ } >Release-Note: >Audit-Trail: >Unformatted: