Package: duck
Version: 0.10
Severity: wishlist
Tags: patch

By default program enables color. However if run inside standard Emacs
M-x shell, the color cored are not interpreted and the output looks
garbled.

Please consider applying the following patch which adds exception for
Emacs.

Consideration not to enable colors by default
-----------------------------------------------

(1) In general, it might be considered that programs wouldn't use
colors by default. It's quite impossible to select correct colors for
various terminals considering that user may have chosen their own
default backgrounds and foregrounds -- thus the program's choices may
not play well with the users' selected colors.

(2) Typically features are enabled by request.

E.g in git(1) colors are enabled explicitly.
>From e35a09133f782a205396288bbc5a52b7fba188ed Mon Sep 17 00:00:00 2001
From: Jari Aalto <jari.aa...@cante.net>
Date: Fri, 11 Nov 2016 06:32:26 +0200
Subject: [PATCH] Disable colors in Emacs M-x shell
Organization: Private
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit

Signed-off-by: Jari Aalto <jari.aa...@cante.net>
---
 duck | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/duck b/duck
index e89d982..8d09c9c 100755
--- a/duck
+++ b/duck
@@ -67,7 +67,17 @@ my $checksdir='/usr/share/duck/lib/checks';
 
 my $try_https=0;
 my $nocolor=0;
+
 our $enforceColor="auto";
+
+if (exists $ENV{'INSIDE_EMACS'})
+{
+    # Program is being run inside
+    # Emacs M-x shell buffer
+
+    $enforceColor = "never";
+}
+
 my @allowedColorVals=qw/always auto never/;
 my $showMissingHelpers;
 my $urlFixEnableOptions;
-- 
2.9.3

Reply via email to