From owner-svn-src-all@freebsd.org Sun May 20 14:21:21 2018 Return-Path: Delivered-To: svn-src-all@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 67122EE2499; Sun, 20 May 2018 14:21:21 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 176EF80EEC; Sun, 20 May 2018 14:21:21 +0000 (UTC) (envelope-from dumbbell@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 ECB32177E4; Sun, 20 May 2018 14:21:20 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4KELKbg067887; Sun, 20 May 2018 14:21:20 GMT (envelope-from dumbbell@FreeBSD.org) Received: (from dumbbell@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4KELKmY067883; Sun, 20 May 2018 14:21:20 GMT (envelope-from dumbbell@FreeBSD.org) Message-Id: <201805201421.w4KELKmY067883@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dumbbell set sender to dumbbell@FreeBSD.org using -f From: =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= Date: Sun, 20 May 2018 14:21:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333925 - head/sys/teken X-SVN-Group: head X-SVN-Commit-Author: dumbbell X-SVN-Commit-Paths: head/sys/teken X-SVN-Commit-Revision: 333925 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2018 14:21:21 -0000 Author: dumbbell Date: Sun May 20 14:21:20 2018 New Revision: 333925 URL: https://svnweb.freebsd.org/changeset/base/333925 Log: teken, vt(4): Parse the "Cursor style" escape sequence The escape sequence (e.g. `^[[2 q`) was unsupported before and the letter `q` was displayed as a typed character. The sequence is used by Neovim for instance. Now, it is properly parsed. However, it is ignored, so it won't change the cursor style. Because the escape sequence contains a space character, the `gensequences` script had to be modified to support that. In the `sequences` file, a space is represented as the string `SP`. Modified: head/sys/teken/gensequences head/sys/teken/sequences head/sys/teken/teken_subr.h Modified: head/sys/teken/gensequences ============================================================================== --- head/sys/teken/gensequences Sun May 20 06:14:12 2018 (r333924) +++ head/sys/teken/gensequences Sun May 20 14:21:20 2018 (r333925) @@ -35,10 +35,19 @@ function die(msg) { function cchar(str) { if (str == "^[") return "\\x1B"; + if (str == "SP") + return " "; return str; } +function csequence(str) { + if (str == "SP") + return " "; + + return str; +} + BEGIN { FS = "\t+" @@ -57,7 +66,7 @@ while (getline > 0) { prefix = ""; l_prefix_name[""] = "teken_state_init"; for (i = 1; i < nsequences; i++) { - n = prefix sequence[i]; + n = prefix csequence(sequence[i]); l_prefix_parent[n] = prefix; l_prefix_suffix[n] = sequence[i]; if (!l_prefix_name[n]) Modified: head/sys/teken/sequences ============================================================================== --- head/sys/teken/sequences Sun May 20 06:14:12 2018 (r333924) +++ head/sys/teken/sequences Sun May 20 14:21:20 2018 (r333925) @@ -48,6 +48,7 @@ CUF Cursor Forward ^[ [ a n CUP Cursor Position ^[ [ H n n CUP Cursor Position ^[ [ f n n CUU Cursor Up ^[ [ A n +CS Cursor style ^[ [ SP q r DA1 Primary Device Attributes ^[ [ c r DA2 Secondary Device Attributes ^[ [ > c r DC Delete character ^[ [ P n Modified: head/sys/teken/teken_subr.h ============================================================================== --- head/sys/teken/teken_subr.h Sun May 20 06:14:12 2018 (r333924) +++ head/sys/teken/teken_subr.h Sun May 20 14:21:20 2018 (r333925) @@ -372,6 +372,25 @@ teken_subr_cursor_up(teken_t *t, unsigned int nrows) } static void +teken_subr_cursor_style(teken_t *t, unsigned int style) +{ + + /* TODO */ + + /* + * CSI Ps SP q + * Set cursor style (DECSCUSR), VT520. + * Ps = 0 -> blinking block. + * Ps = 1 -> blinking block (default). + * Ps = 2 -> steady block. + * Ps = 3 -> blinking underline. + * Ps = 4 -> steady underline. + * Ps = 5 -> blinking bar (xterm). + * Ps = 6 -> steady bar (xterm). + */ +} + +static void teken_subr_delete_character(const teken_t *t, unsigned int ncols) { teken_rect_t tr;