From owner-svn-src-head@freebsd.org Tue Feb 5 16:59:31 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2171414BFC5E; Tue, 5 Feb 2019 16:59:31 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BB4D68367C; Tue, 5 Feb 2019 16:59:30 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AA8D520BDD; Tue, 5 Feb 2019 16:59:30 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x15GxUrA009429; Tue, 5 Feb 2019 16:59:30 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x15GxTwq009425; Tue, 5 Feb 2019 16:59:29 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201902051659.x15GxTwq009425@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Tue, 5 Feb 2019 16:59:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r343778 - in head/sys: dev/syscons teken teken/libteken X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: in head/sys: dev/syscons teken teken/libteken X-SVN-Commit-Revision: 343778 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BB4D68367C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.949,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2019 16:59:31 -0000 Author: bde Date: Tue Feb 5 16:59:29 2019 New Revision: 343778 URL: https://svnweb.freebsd.org/changeset/base/343778 Log: My recent fix for programmable function keys in syscons only worked when TEKEN_CONS25 is configured. Fix this by adding a function to set the flag that enables the fix and always calling this function for syscons. Expand the man page for teken_set_cons25(). This function is not very useful since it can only set but not clear 1 flag. In practice, it is only used when TEKEN_CONS25 is configured and all that does is choose the the default emulation for syscons at compile time. Modified: head/sys/dev/syscons/scterm-teken.c head/sys/teken/libteken/teken.3 head/sys/teken/teken.c head/sys/teken/teken.h Modified: head/sys/dev/syscons/scterm-teken.c ============================================================================== --- head/sys/dev/syscons/scterm-teken.c Tue Feb 5 15:34:55 2019 (r343777) +++ head/sys/dev/syscons/scterm-teken.c Tue Feb 5 16:59:29 2019 (r343778) @@ -144,6 +144,7 @@ scteken_init(scr_stat *scp, void **softc, int code) #ifdef TEKEN_CONS25 teken_set_cons25(&ts->ts_teken); #endif /* TEKEN_CONS25 */ + teken_set_cons25keys(&ts->ts_teken); scteken_sync_internal(scp, ts); break; } Modified: head/sys/teken/libteken/teken.3 ============================================================================== --- head/sys/teken/libteken/teken.3 Tue Feb 5 15:34:55 2019 (r343777) +++ head/sys/teken/libteken/teken.3 Tue Feb 5 16:59:29 2019 (r343778) @@ -66,6 +66,8 @@ .Fn teken_set_8bit "teken_t *t" .Ft void .Fn teken_set_cons25 "teken_t *t" +.Ft void +.Fn teken_set_cons25keys "teken_t *t" .Sh DESCRIPTION The .Nm @@ -194,11 +196,24 @@ which can be used to support character sets like CP437 .Pp The .Fn teken_set_cons25 -function switches terminal emulation to +function sets the terminal emulation to .Dv cons25 , -which is used by versions of +which was the default for +.Xr syscons 4 +in versions of .Fx prior to 9.0. +This function is only useful for initialization. +The emulation can be changed at any time using an escape sequence, +and this function is not used then. +.Pp +The +.Fn teken_set_cons25keys +function tells the +.Fn teken_get_sequence +function to not interpret special keys in +.Dv cons25 +mode. .Sh SEE ALSO .Xr ncurses 3 , .Xr termcap 3 , Modified: head/sys/teken/teken.c ============================================================================== --- head/sys/teken/teken.c Tue Feb 5 15:34:55 2019 (r343777) +++ head/sys/teken/teken.c Tue Feb 5 16:59:29 2019 (r343778) @@ -412,7 +412,14 @@ void teken_set_cons25(teken_t *t) { - t->t_stateflags |= TS_CONS25 | TS_CONS25KEYS; + t->t_stateflags |= TS_CONS25; +} + +void +teken_set_cons25keys(teken_t *t) +{ + + t->t_stateflags |= TS_CONS25KEYS; } /* Modified: head/sys/teken/teken.h ============================================================================== --- head/sys/teken/teken.h Tue Feb 5 15:34:55 2019 (r343777) +++ head/sys/teken/teken.h Tue Feb 5 16:59:29 2019 (r343778) @@ -212,6 +212,7 @@ const char *teken_get_sequence(const teken_t *, unsign /* Legacy features. */ void teken_set_8bit(teken_t *); void teken_set_cons25(teken_t *); +void teken_set_cons25keys(teken_t *); /* Color conversion. */ teken_color_t teken_256to16(teken_color_t);