[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-ed] Editing text with terminal escape codes

From: Criveti Mihai
Subject: [Bug-ed] Editing text with terminal escape codes
Date: Sun, 14 Feb 2016 13:29:21 +0000

Honestly, can't tell if this is a bug or ed just 'works as designed'. Either way, the test case is appropriate given the significance of today's date :-).

# Summary:

Editing text containing terminal escape codes with `ed` could lead to having said codes interpreted by the terminal - making `ed` unusable (requiring something unwieldy like `vi` or `emacs` to solve the problem).

The outcome is similar to using `cat` on a binary file.

# How to reproduce:

1. Download `https://raw.githubusercontent.com/minimaxir/big-list-of-naughty-strings/master/blns.txt` (escape codes could be stripped by mail clients, etc. so it's best to download this test case).

2. Edit the file with `ed`, and print (1,$n or 1,$p or whatever the line number is, etc.) out the following line:
Roses are red, violets are blue. Hope you enjoy terminal hue

Outcome: your terminal is now blue :-).

Expected result: the line is printed as plain text.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]