Questions tagged [control-characters]

Control characters are non-printing characters used to send signals to the output terminal.

Control characters are generally non-printing characters that are used to send signals to the output terminal.

More information is available on Wikipedia.

218 questions
2
votes
1 answer

Terminal styling (control chars) using the chalk NPM module

Say I have this: //exp.js const chalk = require('chalk'); console.log(chalk.red('foobar')); and then I run at the command line: node exp.js | cat In all the cases I have seen, the colors won't show up. Does anyone know why? Is there a way to get…
Alexander Mills
  • 90,741
  • 139
  • 482
  • 817
2
votes
0 answers

Bug caused by non printable character embedded by Visual Studio

I have some cross platform code that I regularly share between Visual Studio and Xcode (and Vim). At some point, I modified a string in this code, using Visual Studio. That string somehow ended up with an errant '^H' control character (ASCII 0x08)…
Tim Kane
  • 2,599
  • 3
  • 20
  • 19
2
votes
2 answers

Can't escape control character "\r" when extracting file paths

I am trying to open each of the following files separately. "C:\recipe\1,C:\recipe\2,C:\recipe\3," I attempt to do this using the following code: import sys import os import re line = "C:\recipe\1,C:\recipe\2,C:\recipe\3," line =…
2
votes
1 answer

How to construct a regexp that removes characters followed by backspace

I am creating a webserver that people connect to using telnet. Some telnet-clients send data per-line, but others send each and every character as soon as it is typed. In the server, I cache these until a newline is typed. (And therefore we have a…
Qqwy
  • 5,214
  • 5
  • 42
  • 83
2
votes
2 answers

How to get rid of bash control characters by evaluating them?

I have an output file (namely a log from screen) containing several control characters. Inside the screen, I have programs running that use control characters to refresh certain lines (examples would be top or anything printing progress bars). I…
Alex
  • 405
  • 3
  • 12
2
votes
2 answers

Vim: Map Esc Without Affecting Terminal Control Characters

I'm trying to map to turn off search highlighting in Vim. The problem is that keys simulated by the terminal with +Esc are affected. The terminal sends characters much fast than I type. Is there perhaps a way to map key + timeout in vim? The…
Praxeolitic
  • 22,455
  • 16
  • 75
  • 126
2
votes
3 answers

0x202A in filename: Why?

I recently needed to do a isnull in SQL on a varbinary image. So far so (ab)normal. I very quickly wrote a C# program to read in the file no_image.png from my desktop, and output the bytes as hex string. That program started like this: byte[] ba…
Stefan Steiger
  • 78,642
  • 66
  • 377
  • 442
2
votes
1 answer

Posting a form with control characters

I'm puzzled by finding out that newer version of Chrome, Opera and Safari don't allow control characters in text inside INPUT elements. In fact, characters like \1, \x02, \b etc. are simply interpreted as string terminators. var input =…
GOTO 0
  • 42,323
  • 22
  • 125
  • 158
2
votes
3 answers

Is there an Objective-C (NSString) Equivalent of Java's replaceAll("\\p{Cntrl}", "")?

Pretty straightforward question: Is there an Objective-C equivalent that iOS developers can use with NSString objects to do the same thing as Java's replaceAll("\p{Cntrl}", "") call on a String? We already have this in Java: String…
Art Geigel
  • 1,915
  • 3
  • 22
  • 24
2
votes
3 answers

How does one pass a control or nonprinting character to a C program?

Situation: I have a C program that takes a string argument and does stuff to it (details are not relevant.) I want to pass it a string that contains a control character, such as EOF, CR, or LF, and cannot switch my keyboard to raw input mode in the…
mage
  • 626
  • 2
  • 8
  • 18
2
votes
1 answer

Filtering out END OF MEDIUM control characters

I am parsing text using C and am getting an output of 0019 boxes in the terminal. After some research I have found that these are END OF MEDIUM control characters: "Intended as means of indicating on paper or magnetic tapes that the end of the…
Andrei0427
  • 573
  • 3
  • 6
  • 18
2
votes
2 answers

Node.js: How to send control C to child process

I am writing one web-like linux shell using node.js + socket.io. Simple command like, ls, cd are working well. But when issue command like ping google.com, the stdout is printing endlessly. I tried to send Ctrl +C to stdin, but no luck. 1) spawn…
Herry
  • 53
  • 1
  • 3
1
vote
1 answer

Is there a built-in method in Ruby to convert LF to CRLF in a string and vice versa?

We can certainly do it by string.chomp+"\r\n" but I'm wondering is there an elegant way to do it.
mko
  • 21,334
  • 49
  • 130
  • 191
1
vote
1 answer

XML design: describing files that have control characters in their names

I am creating an XML 1.0 application that describes files (like others have done). At present I have a file element that requires a name attribute; the value of that attribute is the name of the file. But I beleive this will not work. File-names…
Raedwald
  • 46,613
  • 43
  • 151
  • 237
1
vote
1 answer

json_decode doesnt decode server's response?

I'm trying to decode a selenium server's response. The server returns: {"sessionId":null,"status":0,"value":{"os":{"arch":"amd64","name": "Windows Server 2008…
Saulius Antanavicius
  • 1,371
  • 6
  • 25
  • 55