F
F
falshunov2018-03-13 05:47:32
linux
falshunov, 2018-03-13 05:47:32

How to colorize telnet output directly in console?

The task is to color some words and regular expressions in the telnet output.
I tried GRC - it parses line by line, and telnet outputs character by character, the output through stdbuf helped a little, but it still comes out clumsily, and stdbuf does not process less than one kilobyte, and GRC itself spoils the markup.
I also tried Rainbow here it was already better, but the problem surfaced in another, when, for example, in a session that was launched using rainbow, you press the up arrow (to select the previous command), it is processed as "^[[A" also does not work TAB and the like.
How do you think this can actually be implemented? What would the functions of the keys work normally and the output be colored?
Is it possible, for example, to correct this rainbow, so that it would be normal, or will it not work in python?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question