diff options
author | Karel Zak | 2017-07-31 11:48:38 +0200 |
---|---|---|
committer | Karel Zak | 2017-07-31 11:48:38 +0200 |
commit | 00e8e677e6c72b756da57ad39a8cf026111c2106 (patch) | |
tree | 8b032784419b8cefdd21303a150bafd319e7b9f2 /text-utils | |
parent | libsmartcols: add scols_table_enable_noencoding() (diff) | |
download | kernel-qcow2-util-linux-00e8e677e6c72b756da57ad39a8cf026111c2106.tar.gz kernel-qcow2-util-linux-00e8e677e6c72b756da57ad39a8cf026111c2106.tar.xz kernel-qcow2-util-linux-00e8e677e6c72b756da57ad39a8cf026111c2106.zip |
column: (-t) disable encoding for non-printable chars
$ echo -e '\033[34mBLUE{1\n\033[31mRED{2\n' | ./column -s '{' -t
BLUE 1
RED 2
Addresses: https://github.com/karelzak/util-linux/issues/490
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'text-utils')
-rw-r--r-- | text-utils/column.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/text-utils/column.c b/text-utils/column.c index 2bb6335cf..d34cfc3f0 100644 --- a/text-utils/column.c +++ b/text-utils/column.c @@ -208,7 +208,9 @@ static void init_table(struct column_control *ctl) if (ctl->json) { scols_table_enable_json(ctl->tab, 1); scols_table_set_name(ctl->tab, ctl->tab_name ? : "table"); - } + } else + scols_table_enable_noencoding(ctl->tab, 1); + if (ctl->tab_colnames) { char **name; |