Questions tagged [ansi-term]
26 questions
23
votes
2 answers
How do I find number of vertical lines available in the terminal?
I'm writing a script which shows the git log for a directory when I cd into it. Such a log can be overwhelming, containing hundreds of lines. So far I have been limiting that to a hard-coded 20 lines (... | head -n 20), which is fine on the screen…
jalanb
- 578
- 4
- 15
14
votes
1 answer
What type of encoding do these ANSI artworks use?
I've found this website; it has zip files (links on the main page) with all the artworks. Some of them have an .ans extension and they look like ANSI escape codes used on Linux/Unix, but when I open one of them using cat in the XFce terminal it…
jcubic
- 9,612
- 16
- 54
- 75
8
votes
2 answers
What's the right value of $TERM for emacs' ansi-term, especially if 'eterm-color' isn't available after SSH?
I'm currently setting $TERM to xterm-256color:
if [[ -n "$EMACS" ]]; then
export TERM=xterm-256color
alias emacs="emacsclient --no-wait"
export EDITOR="emacsclient --no-wait"
export VISUAL="emacsclient"
fi
I used to have it set to…
Stefano Palazzo
- 608
- 6
- 20
8
votes
2 answers
How to use ESC sequences to make terminal region scrollable
I have a stm32f1 controlled device that uses USART/USB port to implement a user control interface. Using a standard terminal software (putty/minicom) a user has an ability to enter simple command in device shell.
There is a problem. In case of many…
Ruslan Popov
- 181
- 1
- 4
6
votes
1 answer
Capture colors with tmux buffer copy (hardcopy)
I am using the following line in tmux for getting a "hardcopy" feature like in GNU Screen:
bind H capture-pane \; save-buffer -b 0 ~/tmux.hardcopy \; delete-buffer -b 0
However, the ANSI colors are not captured to the file. How do I make tmux save…
Janus Troelsen
- 1,463
- 1
- 15
- 27
5
votes
2 answers
Programmatically detect the ANSI escape code supported by terminal
I am playing around with shell scripts that use ANSI codes and found that for one reason or another different escape codes are supported depending on your terminal/OS.
In some cases I get a dump of unparsed gunk unexpectedly, which I'm assuming…
qodeninja
- 709
- 3
- 10
- 18
4
votes
2 answers
Graphical console applications in Emacs
I am having trouble running htop within an ansi-term in Emacs 24.2. It looks like some of the control characters are not interpreted correctly.
I thought ansi-term was capable of handling font control characters. Is there a way to have ansi-term…
Amelio Vazquez-Reina
- 40,169
- 77
- 197
- 294
4
votes
0 answers
Colorize the PS4 prompt?
With the option set -x, each command is echoed to STDERR before execution, prefixed by the expanded $PS4, with the first character being repeated according to the call stack depth.
I want the output of the $PS4 prompt to be colorized. I.e. where…
kdb
- 199
- 4
4
votes
2 answers
Why does 'cal' use weird 08 / ^H / \b terminal code for highlighting and how does that work?
When you run cal on Linux, the output for the current month will reverse video highlight the current day. When I send that output to hexdump -c, I get some interesting results:
0000000 N o v e m b e r 2 0 1 …
deltaray
- 1,301
- 2
- 11
- 19
3
votes
1 answer
Emacs ansi-term with zsh: error in process filter. Invalid face: unspecified
I have the latest stable versions of Emacs (24.3) and of Zsh (5.0.2).
I can run Zsh without problem from a terminal (e.g. ITerm2), but if I try to run it from M-x ansi-term I get the error:
Emacs ansi-term with zsh: error in process filter. Invalid…
Josh
- 1,694
- 3
- 16
- 32
3
votes
1 answer
Convert screen log to html
I would like to log actions made in a terminal window, and convert the log to html on fly.
I already tried commands script/screen + ansi2html, but the result is not perfect: the escape sequences for line editing is not handled correctly, so in the…
Attila Szlovencsák
- 131
- 5
3
votes
1 answer
Which terminals or terminal emulators support hardware windows?
terminfo(5) manual page describes a set of capabilities wnum (maximum number of definable windows), cwin (define a window), wingo (go to window), wind (resize current window), but only one terminal definition in terminfo master file uses any of them…
sendmoreinfo
- 2,533
- 21
- 36
3
votes
2 answers
How to get a human-readable (e.g. RGB) value from `\e]11;?\a`?
The string \e]11;?\a presumably yields the current terminal's background color, but I have not found a way to use this information to get the color in a human-readable (e.g. RGB) format.
I did try (cluelessly)
print -P '\e]11;?\a'
but it produces…
kjo
- 14,779
- 25
- 69
- 109
3
votes
2 answers
change colour of `echo` for particular line in shell script in Linux?
I want to change the colour of echo for a particular statement in a Linux shell script
example :
echo "invalid entries"
echo "valid entries"
echo "valid entry"
I want the red color for echo "invalid entries" statement; the rest of them should…
Girdhar Singh Rathore
- 211
- 1
- 3
- 10
3
votes
1 answer
Passing escape sequences to shells within ansi-term in Emacs
In a regular terminal (e.g. iTerm2 on OS X) I can connect to a database, e.g.
> psql ....
and then, as I type my command in psql, e.g.
$ select foo from bar
I can move around (as I type psql commands) using the standard Alt+b and Alt+f.
However,…
Amelio Vazquez-Reina
- 40,169
- 77
- 197
- 294