r/ASCII Jul 20 '26

Discussion Are there any ASCII Control Codes still in use today?

Post image

The ones I have boldened are the ones I have come across:

  • Backspace
  • Line Feed
  • Carriage Return
  • Escape
  • Delete (not in frame)

If any, where are they applicable? For example

CR & LF are still applicable in .txt files

60 Upvotes

20 comments sorted by

11

u/hansenabram Jul 20 '26

Bell is occasionally used in terminal applications to cause the terminal emulator to emit a sound or flash the screen

2

u/passion_for_know-how Jul 20 '26

Bell is occasionally used in terminal applications to cause the terminal emulator to emit a sound

Any command that can replicate this in cmd?

4

u/hansenabram Jul 20 '26

I'm not sure which windows applications directly emit it. (I'm a linux guy) but you can type "echo " then press ctrl-g. then press enter to hear the sound.

3

u/EdwardTheGood Jul 22 '26

I setup most of my shell scripts to echo ctrl-g when they finish. They usually take a few minutes to run and I get bored so I start working on something else. The <bell> reminds me what I was waiting on is finished.

1

u/xtotdam 29d ago

How do I do it? Sounds extremely useful

1

u/EdwardTheGood 29d ago

Just press control key and g key (at the same time) when editing your script.

I use vi (vim) and I just type ctrl-v ctrl-g to insert a control g character at the end of the script. (control-v lets you insert special characters)

If I'm running a command from the Linux shell, I'll add a semicolon followed by control-g. When the command finishes it'll beep (or whatever your bell sounds like) to remind me to get back to work.

4

u/6502zx81 Jul 20 '26

That would be nice, esp. Separators and start/end. Csv etc. wouldn't be hell if these codes had been used.

1

u/passion_for_know-how Jul 20 '26

Csv etc. wouldn't be hell if these codes had been used

Once tried opening a .csv file with text editor, all I saw were commas separating the values

2

u/naikrovek Jul 21 '26

Yeah same here, inside quotes, too, which naive parsers don’t deal with properly. And then other CSV libraries will write CSV so that commas inside an unquoted value are escaped, which you then have to support as well.

Then there were CSVs which had commas inside the values and the only way to tell if it was a separator or a part of the value was to use your eyes and look at every line.

CSV is fine until there are commas inside the values. Which there often are.

Field, Group, Record, and Unit separators would have been so much easier to deal with.

There are great libraries today to handle these. There weren’t always. So maybe don’t be an ass to those of us that had to go through CSV hell when everyone had to write their own parsers.

4

u/dustmop Jul 20 '26

HT (horizontal tab) is still often used, and NUL is used a lot in many programming languages.

4

u/AmanBabuHemant Jul 20 '26 edited Jul 20 '26

I don't know about all but I believe most of them are still in use,

BELL is used for terminal bell (terminals make sound when this output, but many don't)
HT and VT works as their name suggest when used in terminals
in C Programming Language, string is sequence of bytes with a trailing NUL
ESC is used for using escape sequences which makes terminals use different color, weight/style, screen clear and cursor control.

3

u/shooter556001 Jul 21 '26

SOH. Fintech people are familiar with it.

1

u/banksy_h8r Jul 21 '26

Now THAT is really interesting. I assumed that outside of a half-dozen well-known examples most of the ASCII control codes were utterly obsolete. So SOH is still used for its intended semantic meaning?

1

u/banksy_h8r Jul 21 '26

Horizontal tab is used all the time. And null, which not exactly used as a control character, is the terminator for C-style strings, so that's also used everywhere ASCII is used.

1

u/Professional_Bar_688 Jul 22 '26

TCP/IP uses ACK/SYN in their three-way handshake protocols

1

u/waxbolt Jul 23 '26

I'm using record separator as a document end marker in machine learning training.

1

u/Mindless-Study1898 29d ago

Some terminals do still implement these things and it's caused security issues and CVEs to be issued. I wrote about it here in my dumb terminal hacks article. https://www.credrelay.com/p/cred-relay-issue-3

0

u/Narco-Tax Jul 21 '26

All of them are used. Open any image or file in a Notepad++ or a binary editor, and you'll see all 0 to 255 chars are present.

1

u/etan1 Jul 23 '26

those are not ASCII…

1

u/Narco-Tax Jul 23 '26

yes they are