From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Matthew Keeter Newsgroups: gmane.lisp.guile.user Subject: Readline behavior with colored custom prompt Date: Thu, 25 Feb 2016 12:20:54 -0500 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1456420888 23017 80.91.229.3 (25 Feb 2016 17:21:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 25 Feb 2016 17:21:28 +0000 (UTC) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Thu Feb 25 18:21:23 2016 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aYzbG-0000QA-R3 for guile-user@m.gmane.org; Thu, 25 Feb 2016 18:21:15 +0100 Original-Received: from localhost ([::1]:44809 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYzbF-0007aO-U0 for guile-user@m.gmane.org; Thu, 25 Feb 2016 12:21:13 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49423) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYzb4-0007aB-1j for guile-user@gnu.org; Thu, 25 Feb 2016 12:21:02 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aYzb0-00047K-Pr for guile-user@gnu.org; Thu, 25 Feb 2016 12:21:01 -0500 Original-Received: from mail-qg0-x22e.google.com ([2607:f8b0:400d:c04::22e]:33118) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYzb0-00046s-Fo for guile-user@gnu.org; Thu, 25 Feb 2016 12:20:58 -0500 Original-Received: by mail-qg0-x22e.google.com with SMTP id b35so45067344qge.0 for ; Thu, 25 Feb 2016 09:20:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:content-type:content-transfer-encoding:subject:message-id:date :to:mime-version; bh=TS8vhbMVzJfNDf6CwlPKKxK+E9vXI0QPs5Mj8AZQnOU=; b=C1KkXstnORobdTtTI56Z3309iYdwuXBl+wvksH/wNTgSjWhIFOi69k8ito5ATRy1Nu L5x3sZZuUcpb0M8lw4AXGvv70aIZ3LMf7ATcZS463QXqpTFlzNgn6135S9wZKkaS1qzO VJT5A5TYJiLEcZlMy+TugxtTpyGh0w4KtO6bCwXqXRGGvIYh+N9jAfrCrfhISWkFVaa9 QcPrQJrY52s6Bzpl69J/anT8FBKkyA//MbAUOkbQIRkiClRj40uwDwWwPsJrhFC/tJSP b/qRx8JMnZzNeUqU2eKE2ODW0P6PVt48aIFPTJGUQ8bX6UJWgdjpvNTGUyti5OnwHkG6 71jA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:content-type:content-transfer-encoding :subject:message-id:date:to:mime-version; bh=TS8vhbMVzJfNDf6CwlPKKxK+E9vXI0QPs5Mj8AZQnOU=; b=TKarCO8y41aefpNG+N8nFy8Ooo4E+wdYUbKia4uWaCXIg41arAWiavOMUKejNNPQbW 4/kAXHoJ/iDfX0UFS4Yfxd1yB6dNL7nG3xn9qngP7hJumgLrUCZYPAW7mIH7Oik/Estt YZjrmT89Zu1e0wNg38Y+wTNGD7oJ+2LQP6lkQBDHP6BQ11a1W+ICkVNRD7HaQXAMrMSW 4tmuvK0kGCqg2WvOV6whGfU0qsth0IOel98hQI+G7PbqZs3RqGAHQ/x4XHTrsFSJqGbR /VKl5I5qkWzOrhkel0pzKfNA/wWXFonjsJx92wJo9/tka6uTG/woNo66yQfF0gDuXU1q 1SaQ== X-Gm-Message-State: AG10YOQebp4wHyjykiRHCEL4+qgW/4ALUAFvRa07uuRLFpYp9S0qV+9IkISXJiEJbrJzwA== X-Received: by 10.140.42.39 with SMTP id b36mr56844734qga.4.1456420857274; Thu, 25 Feb 2016 09:20:57 -0800 (PST) Original-Received: from [10.0.0.218] ([209.6.175.242]) by smtp.gmail.com with ESMTPSA id n48sm3639881qgd.38.2016.02.25.09.20.55 for (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 25 Feb 2016 09:20:56 -0800 (PST) X-Mailer: Apple Mail (2.1878.6) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400d:c04::22e X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:12446 Archived-At: Hi all, I=92m seeing strange behavior with readline's interaction with ANSI = codes. Here=92s a minimal sample script that reproduces the behavior: = ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;= ;;;;;; (use-modules (system repl repl) (system repl common)) (use-modules (ice-9 readline)) (define (custom-prompt repl) "\x1b[34m :D > \x1b[0m") (activate-readline) (repl-default-option-set! 'prompt custom-prompt) (start-repl) = ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;= ;;;;;; Run this and you=92ll get a Guile shell. Into that shell, type '(1 2 3 4 5 6 7 8 9 10) The final parenthesis will highlight a character midway through the = string (instead of the first parenthesis). The same issues happen if you try to scroll through history: lines end = up overlapping in strange ways. Removing the ANSI codes from custom-prompt resolves the issue, but I=92d = really like to have a colored prompt and correct readline behavior. Does anyone have any ideas? Thanks, Matt=