Skip to main content

Questions tagged [control-characters]

Use this tag for questions about control characters – non-printing characters used to send signals to the output terminal.

1 vote
1 answer
237 views

What is PS1 prompt \[\e]0; vs \[\e]2; , it looks like one is for title name of tab, one is for title name of windows

here is my ps1 does someone know documents about this? export PS1='\[\e]0;YYY@\h:\w\a\]\[\e]2;XXX\W\a\e[32;40m\]\[\e[36;40m\]$?\[\e[31;40m\]\D{%d}\[\e[35;40m\]\D{%H%M}\[\e[36;40m\]\W\[\e[32;40m\]>\[...
user3073309's user avatar
0 votes
2 answers
202 views

Difference between non-graphic characters and non-printable characters

My system: Ubuntu 22.04.3 LTS GNU bash, version 5.1.16(1)-release (x86_64-pc-linux-gnu) man ls describes -b as follows: -b, --escape print C-style escapes for nongraphic characters The ...
yossi-matkal's user avatar
0 votes
0 answers
76 views

Binary file with field seperator ^A is not loading using SQLLDR

I'm trying to upload .dat file to Oracle DB using SQLLDR.  File data columns are separated by "^A".  File charset is of binary. bash-4.4$ file -i /tmp/t_details_all_data_20240209.dat /tmp/...
Pat's user avatar
  • 239
2 votes
0 answers
40 views

Apply control charactes to file reddirect

Tried various existing answers, but didn't find any which entirely works. This is one line example, and show how it fails, maybe some extra switch or step can solve this? This is the content of file I ...
watbywbarif's user avatar
1 vote
3 answers
407 views

Where are the characters going?

In a shell where \u is valid (bash +4.3, ksh93 or zsh) we can print Unicode characters: $ printf 'a b c \ua0 \ua1 \ua2 \ua3 \n' a b c ¡ ¢ £ Which are some characters from the Latin-1_Supplement ...
QuartzCristal's user avatar
1 vote
2 answers
435 views

color codes messing up table formatting of printf to xterm

My script-in-progress displays a multi-column colorized table, but the color-codes are interfering with the formatting. The color codes cannot be moved to the format string because the coloring of ...
Mic's user avatar
  • 11
1 vote
1 answer
1k views

xterm does not support osc 52

I use xterm that comes with XQuartz on my macbook. However OSC 52 control sequence doesn't seem to work. Here's how to repro: open xterm in the shell, issue printf '\e]52;c;%s\007' $(printf 'test off'...
KFL's user avatar
  • 307
13 votes
1 answer
2k views

Why do ^M and \r behave inconsistently?

Perhaps there are already answers out there that indirectly answer my question, but I've read many of them and haven't yet found a satisfactory answer to this discrepancy. The original meaning of ...
mgarort's user avatar
  • 475
3 votes
1 answer
543 views

What can the C1 control codes be used for?

Today I discovered that there is a significantly large group of additional control codes, called C1 control codes, spanning from U+0080—U+009F (32 characters). I think that it's an interesting fact ...
psprint's user avatar
  • 251
0 votes
0 answers
327 views

Control characters in bash history scramble subsequent lines

Sometimes, when I invoke history in bash, it starts printing normally, and at some point switches to garbled characters: Oddly, when I copy that from my terminal and paste it here, the characters are ...
Jacktose's user avatar
  • 532
7 votes
1 answer
939 views

gnome-terminal: strange control characters on Alt key

I probably misconfigured something, but I don't know what. (see UPDATE 1 and 2 below) In gnome-terminal, when I hit Alt (without any other key), it immediately sends ^[< to the terminal (I tested ...
Stuck's user avatar
  • 171
2 votes
2 answers
2k views

How can I change CMD to CTRL in Linux Mint only in Terminal?

I installed Linux Mint on my MacBook Air, and I prefer to use Cmd for copying/pasting, opening and closing windows, and general things like that. However, I would like to use Ctrl to input to the ...
user avatar
1 vote
0 answers
579 views

Why are rapid Ctrl-Space sequences sometimes handled differently by GNU screen than slow Ctrl-Space?

I have GNU screen configured to use Ctrl+Space as the escape character. This means that Ctrl+SpaceSpace will send a literal Ctrl+Space to the process in the window. Also, Ctrl+Space Ctrl+Space is the ...
Wildcard's user avatar
  • 37.5k
0 votes
2 answers
163 views

How to dynamically look up shell variable name [duplicate]

I have this situation: zmx_stderr='\033[1;35m' zmx_stdout='\033[1;36m' tag='foobar' tailing(){ echo "tailing logs for ${tag} ..."; while read line; do echo -e "$zmx_${1} $tag $1${zmx_no_color}...
user avatar
5 votes
1 answer
7k views

`cat -v` for non-printing non-ascii UTF characters

cat has a -v option which converts non-printing characters to their caret notation (which is useful if we don't want the terminal to interpret the control characters literally in cat output). But ...
flow2k's user avatar
  • 641

15 30 50 per page