Tagged Questions

The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
0answers
8 views

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 ...
0
votes
1answer
48 views

Shell string escape for command arguments [duplicate]

I'm trying to create "/tmp/pwet/foo bar" with this: DIR="/tmp/pwet/foo bar" ARGS="-p ${DIR}" mkdir $ARGS For integration reasons, I have to keep the ARGS building in 2 steps: ARG = some_options + ...
1
vote
0answers
23 views

Echoing Backspace Characters in the Terminal

I'm working with picocom running inside gnome-terminal. I have local echo switched on inside picocom using the -e option, and when I backspace I can see that caret moves backwards, however the ...
1
vote
0answers
14 views

cssh intercepts F10

I am using cssh (cluster-ssh) to ssh to multiple machines simultaneously. Everything works great, except that cssh intercepts F10 key (which in cssh opens menu. This is very unfortunate, because I ...
1
vote
4answers
56 views

What is '“^[b” backward-word' When trying to configure ZSH?

I am on a MAC, and I am trying to figure out shortcuts for my ZSH running on Iterm2. When I type bindkey in the shell, I see (among other mappings), the following: "^[b" backward-word "^[f" ...
0
votes
1answer
48 views

ANSI escapes in Pash prompt are displayed as garbage in Gnome terminal

I would like to use Pash, a PowerShell implementation for mono on my CentOS box. After compilation I started it and got $ mono Source/PashConsole/bin/Debug/Pash.exe ...
1
vote
0answers
48 views

How can you (programatically) 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 ...
4
votes
2answers
200 views

How to escape single quotes correctly creating an alias

I've been given this one-liner to know how much memory my processes consume. $ ps -u $USER -o pid,rss,command | \ awk '{print $0}{sum+=$2} END {print "Total", sum/1024, "MB"}' Now I'd like to ...
4
votes
2answers
52 views

Sorting strings with ANSI escape codes

I am trying to print a sorted list of all zsh options, with set options colored green and unset options colored red. I cannot get sort to work properly with on the colored lines though.The below ...
2
votes
2answers
62 views

Non-printing escape sequence: when?

Recently, I have been playing around a lot with color in the terminal and, therefore, with escape sequences, too. I've read the relevant parts of the Bash manpage along with numerous helpful pages on ...
0
votes
2answers
40 views

How to printf an exclamation point in tcsh?

What's the best way to printf an exclamation point in tcsh? It seems like using single or double quotes has no effect on escaping the exclamation point; and using a backspace does work, but then it ...
1
vote
2answers
55 views

When to use bash ANSI C style escape, e.g. $'\n'

I don't use bash often but I recall in the past to pass a tab or newline on the command line I would have to escape the character using the special $ character before a single quoted string. Like ...
0
votes
1answer
46 views

Can I get my iTerm key-combos working in tmux?

I have some shortcut keys defined in iTerm, and I use them for key-mappings in Vim. For example, I map Ctrl-Enter to send a ^[O2P escape code, which I then use to define a Ctrl-Enter key-mapping in ...
2
votes
1answer
48 views

What does xterm's Escape Sequence option do and how do I enable it?

xterm's control-right-click menu contains an option named Escape sequence. It is always disabled ("grayed out") in Ubuntu-14.04. What is this option is used for? How do I enable it? I am looking for ...
5
votes
2answers
175 views

Escape code 50 in xterm

My coworker has the following in the ~/.bash_profile of many of our servers: echo -e "\033]50;SetProfile=Production\a" The text doesn't seem to matter, since this also works: echo -e ...
2
votes
2answers
26 views

How to escape a Whole Variable?

In the answer of thisquestion: https://superuser.com/questions/163515/bash-how-to-pass-command-line-arguments-containing-special-characters It said that we have to put an arg of a function in ...
1
vote
1answer
29 views

What standard shell command can evaluate escaped Unicode in a stream?

I'm looking for a pipeable command that will convert substrings in the form of ‘\unnnn’ to the actual characters. For example: $ echo 'co\u00ebfficient' | what_command coëfficient
2
votes
1answer
42 views

Tar actions not working as intended

I have a huge uncompressed tar file (1 tb) and I want to check it, therefore I am trying to extract it to see if everything goes well. Since it is going to take a long time, I'd like to have some info ...
1
vote
1answer
43 views

Why does sed globally substitute only the first occurence in multiple substiutions?

I want to globally substitute all \n new line characters with their \n escape sequence and all ' single quote characters with two '' of them like so: function esc_foobar { # Escapes any "'" ...
2
votes
2answers
59 views

Meaning of backslash

Why the following command prints Smith but not \Smith? echo \Smith
5
votes
1answer
659 views

Why do I have to escape a “dot” twice?

I know that we can escape a special character like *(){}$ with \ so as to be considered literals. For example \* or \$ But in case of . I have to do it twice, like \\. otherwise it is considered ...
2
votes
3answers
367 views

What is the problem with the output of plink?

On my Windows7 machine, I'm traversing to the installed path of PuTTy Application and running: plink <hostname> to connect to my remote Linux host. I see some unrecognized characters in the ...
4
votes
2answers
2k views

How to change font colors in terminal?

I know how to change the font color via preferences, but it changes the color of ALL text, as in below:     What I'm going for is something more like this:     Any ...
0
votes
1answer
1k views

Proper escaping of double quotations for curl post data?

I'm trying to test out a server, by sending it JSON data and reading the response. I need to POST data like {"item":"value with spaces"} but when I use curl I find that it sends the backslashes as ...
3
votes
4answers
101 views

is there a pastebin service that supports terminal escape sequences?

Is there a pastebin service that supports colors? I understand some of them have syntax hilighting, but I'd like to do arbitrary coloring, preferably using the terminal escape sequences. Example, i'd ...
1
vote
1answer
49 views

Proper use of escape characters in desktop file

I have a command with a working .desktop Exec key as follows: Exec=env XDG_CONFIG_HOME=/home/bean/.config/gedit/ gedit %U I would like to use the $HOME variable instead and it works in the terminal ...
1
vote
1answer
351 views

Exit of “> ” mode in Unix shell

In sh (not Bash), how would we abort execution of command when the prompt is in > mode? For example, when entering a string with quotes only at the beginning, it makes the prompt look like >, ...
1
vote
1answer
179 views

Cat and Less give different output

I executed the following command # top > /home/user/top_output.txt Nothing Happened for a while and then i pressed Ctrl+C. When i checked the file that was created, it had the contents in it. So ...
5
votes
2answers
5k views

Why does Ctrl-D (EOF) exit the shell?

Are you literally "ending a file" by inputting this escape sequence, i.e. is the interactive shell session is seen as a real file stream by the shell, like any other file stream? If so, which file? ...
4
votes
1answer
252 views

How to find out the escape sequence my keyboards sends to terminal?

Let's say we have a generic keyboard with some unknown keys which may send escape sequences to terminal. The keyboard is connected to an xterm terminal emulator running on a generic BSD/Linux. To ...
2
votes
2answers
162 views

Weird escape sequence

I need help identifying what this escape sequences represents. I see this sequence is autogenerating on my server's console, but I'm not sure what is the reason for that. Escape sequence: ^[[[D I've ...
3
votes
1answer
47 views

How do I generate the sequence “\e[Z” in a terminal?

It is bound to menu-complete in GNU readline. $ bind -p|grep menu "\e[Z": menu-complete # menu-complete-backward (not bound) # old-menu-complete (not bound) I think it's Meta-something.
3
votes
5answers
705 views

What are the special characters to print from a script to move the cursor?

I found that by printing \r from a script the cursor moves to the beginning of the line. What character will move the cursor up one line? Where is a list of these special characters? EDIT: Working ...
13
votes
4answers
923 views

Is there any reason why I get ^[[A when I press up arrow at the console login screen?

Whenever I'm at the console login, I press up arrow intentionally to see the previously typed commands. But I see this ^[[A. But when I press Ctrl Alt Print Screen Scroll Lock Pause Break Page Up ...
2
votes
1answer
175 views

Garbled text in tmux menus

I am trying to use the st terminal, but after starting tmux (or screen) in a remote ssh session, the text becomes all garbled. Exiting tmux/screen makes text normal again. Now, I have found that this ...
3
votes
0answers
186 views

How to create a bash command which creates output that exactly mimics a source text file that can be pasted into bash shell where histexpand is on?

The goal is to create a bash one line command that can be copied and pasted - for instance published on a web forum - and then patches files. See it as a way to distribute a patch file by copy and ...
2
votes
2answers
344 views

Maximize xterm via bash script

I have found this answer providing how to manipulate the current xterm window's dimensions, ie: echo -ne "\e[8;30;30t" How can I modify this to maximize the window (xterm's alt + enter shortcut)? ...
1
vote
5answers
323 views

Deleting all files that begins with parenthesis

I have many files in a directory that begins with parenthesis. They are generated by Dropbox due to conflict. Any combination of escaping does not seem to help: rm -rf "(*" rm -rf "\(*" rm -rf \(* ...
2
votes
1answer
132 views

What characters TAR doesn't like?

I keep a list of photos burned to dvds for incremental backups but I got into a strange situation where a file was already burned into a dvd but tar keeps saying it's not. Here the steps to reproduce: ...
1
vote
0answers
19 views

Using tput in $PS1 is breaking line wrapping [duplicate]

Good Morning- I'm trying to use tput outputs in my $PS1 to set the background color to red in the event I'm on a production server: if [[ `hostname -s` = prod-db ]]; then export ...
2
votes
2answers
647 views

\uFFFD character in directory name

I have a lot of directories with a \uFFFD (65533) character in it. The problem is that I can't really access this directory because of this character. For example I got a directory with the name: ...
5
votes
2answers
420 views

The difference between \e and ^[

Gilles wrote: character 27 = 033 = 0x1b = ^[ = \e Demizey wrote: ^[ is just a representation of ESCAPE and \e is interpreted as an actual ESCAPE character Then I also found this line from ...
7
votes
3answers
5k views

Escape sequences with “echo -e” in different shells

I just noticed that it seems like the flag -e does not exist for the echo command in my shell on Linux. Is this just a messed up setting or is it "normal"? Some code as an example: #!/bin/sh echo -e ...
2
votes
1answer
444 views

highlighting text in shell

I have always been using below method to highlight background of text in shell . tput smso;printf " TEXT ";tput rmso; How can I achieve the same thing without using tput( I mean some way formatting ...
3
votes
1answer
897 views

Visualizing ansi color escape codes in log files correctly in Emacs [duplicate]

I have some log files that have ansi-color codes in them. When I open them in Emacs I see garbage:           As an example, I run the following: ls --color=yes -ald -- * ...
1
vote
1answer
249 views

Cannot echo colored text when inserting in status bar in dwm

I'm using Fedora 18. I'm trying to create a custom status bar in dwm. Now what I'm thinking of is to check if the battery is under a certain level, the background of the battery region in the status ...
2
votes
1answer
166 views

Is it possible to get a character at terminal cursor using ANSI escape codes?

I know I can move the cursor with the escape codes, and I can also print at the cursor. What I'd like to know is if it is possible to pull the character under the cursor. I tried searching for such a ...
6
votes
3answers
3k views

Where do I find a list of terminal key codes to remap shortcuts in bash?

For example: "\e[1;5C" "\e[Z" "\e-1\C-i" I only know bits and pieces, like \e stands for escape and C- for Ctrl, but what are these numbers (1) and letters (Z)? What are the ;, [ and - signs for? ...
0
votes
1answer
77 views

can someone fix my PS1 for bash

I seem to have too many colour escapes so it only works in some prompts - can someone please correct for me ? PS1='\[\e[0:35m[\u@\e[0:33m\h\e[m \e[0:35m\w]\e[m \e[0:33m`git branch 2> /dev/null | ...
5
votes
2answers
3k views

Change colors in console/virtual terminal

Is there a way to alter all the available colors in console / virtual terminal? By console, I mean what you get after pressing CTRL + ALT + F1 and not anything like xterm or urxvt. So, I guess that ...