From owner-svn-src-head@freebsd.org Thu Mar 16 18:45:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56D62D0FDDC for ; Thu, 16 Mar 2017 18:45:03 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-vk0-x236.google.com (mail-vk0-x236.google.com [IPv6:2607:f8b0:400c:c05::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 10D961940 for ; Thu, 16 Mar 2017 18:45:03 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-vk0-x236.google.com with SMTP id j64so14517485vkg.3 for ; Thu, 16 Mar 2017 11:45:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=eu2NNbPGMHArCzSj/8zXDJEzkVe3GPE9ESEcJj0x3gI=; b=k1ErasS+asIjbNUh4/+WB2zDsUokWTHe97rT5QN1aCecYcwL1S4GEBaQL0iY5sNn+m tYLp92+A46DUaDMJhnmrZmWfyrZP7Z9aRLms1NuFKpgxwRz7h0JtnWf1wnhB6uegrZ1F upvUqex4C4OpK1L2FNoH7g8JlL5BBJh0+GwD4gmiRStX1035Oqk/KkuLObdUHUExRitm 5oCl4z7Pd4dMPMmBsyU+37dNuI/T7I4Ih+IzJ7NGvD7BQ2WKrupeumBrl3UMVeMfB6Az KlKU3q7hQ89wE0alXbWKz1rBsxMd6S1HxOjz7TQXuJCrZkdP1OpmUOLXwPIHtU4MmV4s 2dlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=eu2NNbPGMHArCzSj/8zXDJEzkVe3GPE9ESEcJj0x3gI=; b=a2QSevtMuyERHaAIf+b40tLjOnKGvqEpYmGE/VODgK+PTeOVLXNwCRo7fYGJM9GC0o bxKdOORoWCn2PwE4MN3bCbCQ725zh/BNGPtUasmXmUyYe/4AX6iarUMMjgbrfdj4J5E1 mN9+kII0ClS8g9ofRHr1TK81rB8zplvyskK+SpY4cGlHGuBx28ygKGToHrIKhyrgA7p7 w2CBXE0FKP1IToIlTNn6j4m4E1g7v0UcPlN6JgGKe+djtKaGDcHZpaGMsrWIEVxHcdVH EQ4DX8OBbvI6uFWKnM6KXDLoJ0NBOLz8JKTCDei8/ZRO24LIoJJ5N0bdrQ58kz0AOGGD ZcDw== X-Gm-Message-State: AFeK/H3v/DCdTvLfSWU5qVI8eP7t4EYahvxRV7nb2fA/ZIituhLOfaD8VVGjpbSpztwvcXINCIBoPnMgkaiR1hUB X-Received: by 10.31.188.4 with SMTP id m4mr4203629vkf.39.1489689902032; Thu, 16 Mar 2017 11:45:02 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.45.2 with HTTP; Thu, 16 Mar 2017 11:45:01 -0700 (PDT) In-Reply-To: <20170317040832.N26977@besplex.bde.org> References: <201703161640.v2GGes8N033822@repo.freebsd.org> <20170317040832.N26977@besplex.bde.org> From: Oliver Pinter Date: Thu, 16 Mar 2017 19:45:01 +0100 Message-ID: Subject: Re: svn commit: r315418 - in head/sys/teken: . libteken To: Bruce Evans Cc: Bruce Evans , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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: Thu, 16 Mar 2017 18:45:03 -0000 On 3/16/17, Bruce Evans wrote: > On Thu, 16 Mar 2017, Bruce Evans wrote: > >> Log: >> Add teken_256to16() to convert xterm-256 256-color codes to xterm >> 16-color >> codes. This will be used to fix bright colors. >> >> Improve teken_256to8(). Use a lookup table instead of calculations. >> The >> ... > > A shell script for printing some text color maps is attached. Also a > sloppier one for printing some CSI sequences. > > The first one can easily be translated to xterm sequences. I used syscons > F and G sequences to print bright colors with sc and vt since pure xterm > bright colors are too broken to display themselves without bold hacks. > The F and G sequences generate bold hacks in the kernel, and further > complications are needed to turn these off to test if bright colors > are fixed. Real xterm doesn't fake bold using brightness, so bold > hacks on dark characters don't work for it. > > The first one needs the user to load a cp437 font for syscons and a > unicode font for vt. The script doesn't load a font since it is too > hard to restore or reset fonts. Similarly for colors. > > Run the first one on a kernel without this commit to see the old color > map. It looked just wrong (unstructured) before I found a good > tabular format to print it. I then wrote "improved" maps based on > expanding the 2x2x2 and 3x3x3 maps. These were too simple. Some of > the comments/printfs are out of date and still refer to this expansion. If I'm not wrong, these scripts where made on OS X. They use \r\n line endings, and this triggers random cryptic runtime errors: op@opn /tmp> sh -x sc-vt-CSI + printf $'\\033[m\r' + printf $'\\033[x\r' sc-vt-CSI: 5: Syntax error: word unexpected The simple fix is to delete the '\r's from the scripts: cat sc-vt-CSI | tr -d '\r' > trans.sh op > > Bruce