Questions tagged [control-characters]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
42 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 ...
7
votes
1answer
193 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 ...
1
vote
0answers
81 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 ...
0
votes
0answers
49 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 ...
0
votes
2answers
57 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${...
3
votes
1answer
413 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 ...
1
vote
1answer
74 views

screen logging - How to ommit interactive shell control characters and prompt?

One of my first questions. Please comment if further explanation or information is required or if the question is not like it's supposed to be here I'm using screen to automatically start servers (...
5
votes
2answers
135 views

What determines whether backspaces show up in a file created with cat?

I just noticed that I've seen different behavior across different systems when creating a quick test file (e.g. with sample input) via cat and redirection. Here are the steps to see what I'm talking ...
2
votes
3answers
3k views

How to find control characters in a file?

I want to find what control characters are in my file. I do not search for specific character, but it is possible \t or \n. I have a program that is telling me: Invalid control character. But when I ...
1
vote
2answers
33 views

Multi-file multi-directory removal of ^@

I have multiple files in multiple subdirectories where I need to remove all instances of the control character "^@". Just a basic grep doesn't seems to be working. This what I've tried most ...
0
votes
0answers
37 views

when can I view \t as a character which spans a fixed width, instead of a control character which jumps to the next tab stop?

I always thought \t as a character, and never realize they are used by terminals for column/field alignment, until Stephane said What does `pr -e` mean? printf '%b' '\t' or printf '\t' writes a ...
1
vote
1answer
687 views

tmux: backspace and ctrl-backspace send both ^?

With FreeBSD 11.1 and tmux 2.7, pressing ← (backspace) sends ^? and ctrl+← does also send ^?. The default behavior (no tmux) is: ^H for ← ^? for ctrl+← How can I get this default behavior with ...
0
votes
1answer
2k views

What is this sequence of control characters (M-bM-^TM-^@) (dashes)? How can I transform these? [closed]

I have a 'typescript' file that if i cat -v I get the following within the output: M-bM-^TM-^@M-bM-^TM-^@M-bM-^TM-^@M-bM-^TM-^@M-bM-^TM-^@M-bM-^TM-^@M-bM-^TM-^@M-bM-^TM-^@M-bM-^TM-^@M-bM-^TM-^@M-bM-...
-1
votes
1answer
3k views

How to find invalid characters? [closed]

I am trying to filter out record which is having "invalid character"(like control-m ^M characters or simply not valid characters). Example: 12345 vimal 1235566 ^zfood nation Here, the ^z, which in ...
1
vote
0answers
125 views

How to stop python-based borg backup from logging with ^M

I'm trying to make a log file for monitoring backup progress using borg deduplicating archiver. While I am logging, the file contains ^M control characters for each line despite running the script on ...
3
votes
0answers
148 views

Show colors from child shell in parent shell

I solved this once, but I cannot remember how I did! In my child process, I have this: echo -e "some control chars" In my parent process, it will show the plain string, without any terminal styling....
-1
votes
3answers
686 views

Get colors in bash shell [duplicate]

I have this: ql_gray='\033[1;30m' ql_magenta='\033[1;35m' ql_cyan='\033[1;36m' ql_orange='\033[1;33m' ql_green='\033[1;32m' ql_no_color='\033[0m' I use them like so: echo "${ql_magenta}quicklock: ...
1
vote
1answer
148 views

What does an application read when the user press a backspace in the terminal in raw mode?

In raw mode, if you type a character in the terminal, the application on the other side will read the ASCII code for the typed character. But what about when you press the backspace key in the ...
0
votes
2answers
399 views

Prevent the line discipline from handling control characters

When you send a control character from the terminal, for example if you pressed Ctrl+C, the line discipline will receive the byte representing this control character (which is 0x03 in the case of Ctrl+...
0
votes
1answer
78 views

Why do colors not show up (control characters) when piping stdout/stderr on *nix systems?

Why do colors not show up (control characters) when piping stdout/stderr on *nix systems? When I do: foo | bar if foo writes color encoded strings (with control chars) to stdout, they won't show up ...
10
votes
4answers
3k views

Determine how long tabs '\t' are on a line

In a text processing field is there a way to know if a tab is 8 characters in length (the default length) or less? For example, if I have a sample file with tab delimiter and the content of a field ...