From owner-svn-src-all@freebsd.org Thu Mar 16 18:45:04 2017 Return-Path: Delivered-To: svn-src-all@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 5BC4ED0FDE4 for ; Thu, 16 Mar 2017 18:45:04 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-vk0-x230.google.com (mail-vk0-x230.google.com [IPv6:2607:f8b0:400c:c05::230]) (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 1EAA81942 for ; Thu, 16 Mar 2017 18:45:04 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-vk0-x230.google.com with SMTP id x75so29330926vke.2 for ; Thu, 16 Mar 2017 11:45:04 -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=rfUw4pMam5yqtj5mBXaLusKSqVRn2mlTdfm06VjWY1YHRuYa0iEehV0ESWOGqfQEsK NxXj28bwqdNUVi5rxyIsf7oLRGiMtwVl67+CNNRWn07b6NLVHwe4kT6fLZbXOQMhDsOw JS16I9z10BLXR8TOxWWOF16R1k3msseriKC+ltZSdGXLfQoHnXI9Ftud6Wu/kpP5unel asODDA8lAWvgvjcm0J/7KZDBTEErnAa23HxZL85JhWz1mA+8RRujKXZ3oZB7Nt9ZjCoq v2H72XzV7Y0VjS9Yf08dIs7RiecN+ndiS6TEhGMu85k2YWpLUsPRIo2FQ3Kjx1IZKQsy L5+g== X-Gm-Message-State: AFeK/H1QwIDWj17rklXbQEBbW4pqY3JxZQ5xND142GtIzB8WO78Z4L3OdAkb3bSseAH4SQrE4jmtoOdOuwkaLn8T 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-all@freebsd.org X-Mailman-Version: 2.1.23 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: Thu, 16 Mar 2017 18:45:04 -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