New answers tagged

1

Clearing the line has only an indirect relationship to changing the terminal colors: if you change the background color, then many terminals (Linux console, rxvt, xterm as well as programs imitating one of those) will color the cleared area of the background using that color. less does use a few clearing operations, but not \x1b[2K. Reading the source, it ...


1

What reacts to the escape sequences is normally the tty (unless the running program sets it not to honor them, in which case the program itself may do so). more(1) does rather primitive screen rewriting (it is really enough to write out screen length lines, and wait for a keypress), so I'd guess it just passes input through. less(1) needs to back up, so it ...


1

EDIT The answers by vonbrand and Thomas Dickey are more technically accurate. less supports raw ANSI escapes when the -r option is used. It also supports Erase in line. You won't see any animation though. For example: echo -e "foo\x1b[1G\x1b[2Kbar" > test.ansi less -r test.ansi Will only print bar. more does pass on ANSI escapes by default but does ...


2

Do you have already try to set t_Co=256in your vimrc to enable 256-color mode? But this also depends of your terminal capabilities. So if the settings in vimrc is not enough I suggest you have a look to the TERM variable of the terminal you are using: echo $TERMto see what is the current setting. The result should be:xterm-256color or screen-256color. ...


0

In your Terminal, klick Edit > Profile Preferences > Colors See the Text and Background Color Uncheck the Use colors from system theme And set the Build-in schemes: to: Gray on black


1

Terminal colors aren't set in the shell (text colors can be, though, for things like 'ls'). They're specific to the terminal application. In the first picture, it looks like xterm (although I've been informed it is not). I'm guessing the second picture is GNOME Terminal. If you want to use xterm, it may already be on your system; if not, it's just an ...


0

I have created some functions, based on Github code from other threads. You can put these functions in your ~/.bashrc file. As you can see, if you call create_random_profile: It will check and delete any previous random profile you have created. It will create a random name profile in gnome terminals. It will set that name in an environment variable that ...


0

I have found the solution. My ~/.bashrc file was empty. I have copied the one from /etc/skel and uncommended force_color_prompt=yes in it. Now it's all colored.


3

Mac uses BSD ls. See man ls for details. The format of LS_COLORS is different. The variable name isn't even LS_COLORS, it's LSCOLORS. The links I found that were most helpful in figuring this out were this blog post, and this article which was linked to from the blog post. The default value for LSCOLORS is exfxcxdxbxegedabagacad. To leave everything at ...


0

Rather than applying grep to the output of ls which is not post-processable reliably anyway, I'd rather filter on the list of files passes to ls, like: ls -lFhd --color -- .*(/) In zsh. Or as your own approach suggests you only want the directories last modified between 6 months ago and now and not the ones with special permissions: ls -lFhd --color -- ...


6

Parsing ls is often a bad idea. Often, but not always. Here's another suggestion for you, which collects the required directories together before passing the set to ls. find .* -maxdepth 0 -type d \( -name '.[^.]' -o -name '.??*' \) -exec ls -ld --color=always {} + It's been pointed out that the original code actually limits the list of directories to ...


0

Ok I finally figured out how to list all hidden dirs while preserving the Colors and not including dirs like "hello.world": ls -lhAF1 --color | grep -E "^d[rwx-]{9}.*[0-9]{2}:[0-9]{2} "$'\x1b'"\[([0-9]{1,2}m?)(;[0-9]{1,2}m?)?\."


2

The reason is that ls always colorizes its output even if it is connected to a terminal. From man ls: --color[=WHEN] colorize the output. WHEN defaults to 'always' or can be 'never' or 'auto'. More info below Many other tools such as grep do not retain colors when standard output is terminal but for some reasons ls was ...


6

--color adds escape sequences for the color. You can see this if you redirect the output (of ls --color) to a file. This is what it looks like: drwxr-xr-x 6 root root 4.0K Jan 9 08:23 ^[[01;34m.cabal^[[0m/ To account for this, try this instead: ls -lhAF1 --color | grep -E '^d.*[0-9]{2}:[0-9]{2} .*\.'


1

Your $GCC_COLORS is probably set up for a light background instead of a dark one. Check with -fno-diagnostics-colors in your Makefile or whatever build system you use. Bear in mind that build script might be setting that variable. You could also try running without reverse video and see if it works. The GCC manual has documentation on the GCC_COLORS ...


2

Your terminal color scheme conflicts with GCC's default colors. That is, black on black is not visible. This is explained in the manual: The colors are defined by the environment variable GCC_COLORS. Its value is a colon-separated list of capabilities and Select Graphic Rendition (SGR) substrings. SGR commands are interpreted by the terminal or ...


2

You have two options here. 1. You can set the MANLESS environment variable to what ever you need: export MANLESS=" " 2. You can add the -r option to your man command: man -r="" ls Both possibilities are described in the man manual page.


2

Either use 'su -' to get a login shell, or move the aliases to ~/.bashrc. See: http://superuser.com/questions/183870/difference-between-bashrc-and-bash-profile/183980#183980



Top 50 recent answers are included