From ca9627e70852f6b2e835660df870fe3ab405882d Mon Sep 17 00:00:00 2001
From: "Suren A. Chilingaryan" <csa@suren.me>
Date: Sun, 1 Sep 2019 00:00:32 +0200
Subject: Initial import

---
 sys-apps/kbd/files/kbd-1.08-terminal.patch | 31 ++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)
 create mode 100644 sys-apps/kbd/files/kbd-1.08-terminal.patch

(limited to 'sys-apps/kbd/files/kbd-1.08-terminal.patch')

diff --git a/sys-apps/kbd/files/kbd-1.08-terminal.patch b/sys-apps/kbd/files/kbd-1.08-terminal.patch
new file mode 100644
index 0000000..13aeeec
--- /dev/null
+++ b/sys-apps/kbd/files/kbd-1.08-terminal.patch
@@ -0,0 +1,31 @@
+Output terminal control sequences only when output is a terminal.
+
+--- kbd-1.08/src/unicode_start	2002-11-22 19:23:00.000000000 -0500
++++ kbd-1.08/src/unicode_start	2002-11-22 19:24:34.000000000 -0500
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ # Enables Unicode processing in the current console.
+ #
+ # 1. The input side: the keyboard driver.
+@@ -25,7 +25,9 @@
+ # Tell the console output driver that the bytes arriving are UTF-8
+ # encoded multibyte sequences.
+ 
+-echo -n -e '\033%G'
++if test -t 1 -a -t 2 ; then
++	echo -n -e '\033%G'
++fi
+ 
+ # Tell the graphics card how to display Unicode characters not
+ # contained in the IBM 437 character set (on PCs). The font should
+--- kbd-1.08/src/unicode_stop	2002-11-22 19:23:30.000000000 -0500
++++ kbd-1.08/src/unicode_stop	2002-11-22 19:24:15.000000000 -0500
+@@ -1,4 +1,6 @@
+ #!/bin/sh
+ # stop unicode
+ kbd_mode -a
+-echo -n -e '\033%@'
++if test -t ; then
++	echo -n -e '\033%@'
++fi
-- 
cgit v1.2.3