Tag Info

Hot answers tagged

17

First of all, remove that line from your .bashrc. The way to do this in not by playing with $HOME, that variable will always point to your home directory and you don't want to change that just so your shells start in a different place. I'm sure there will be a more elegant way to do this but as a temporary workaround you can simply add this line to your ...


10

The solution is to get the shell to substitute the color variables when defining the prompt, but not the functions. To do this, use the double quotes as you had originally tried, but escape the commands so they aren't evaluated until the prompt is drawn. PS1="\u@\h:\w${YELLOW}\$(virtual_env)${GREEN}\$(git_branch)${RESET}$ " Notice the \ before the $() on ...


8

STDOUT and STDERR don't have colors. What has color is your terminal (emulator); it has one foreground (and one background color) set at a time. It should also be noted that STDOUT and STDERR are not singular -- they're per process output streams. There is no global STDOUT that applies to all programs. These streams are routed to your terminal, but they ...


8

You can also disable eof generally in bash: set -o ignoreeof


7

You can use the IGNOREEOF environment variable in bash. So export IGNOREEOF=42 and you'll have to press Ctrl+D forty-two times before it actually quits your shell. POSIX set has an -o ignoreeof setting too.


7

COLUMNS variable is set by bash upon receipt of a SIGWINCH. (see Shell Variables section in man bash). It is not set in your script because this is not an environment variable. See yourself: $ export COLUMNS=$COLUMNS $ ./your-script.sh Now it works. You need to retrieve value of COLUMNS in your script. You can use tput for example: $ tput cols 186


7

With zsh on terminals that support 16 colors or more à la xterm: preexec() printf '\e[90m' # set foreground color to grey before running # the command precmd() printf '\e[m' # reset the foreground color before issuing the # next prompt. Note that commands may change the terminal's foreground color ...


7

you don't see actual terminals all that often anymore, but for instance the Linux text consoles on (CTRL +) ALT + F1 through F6 are considered terminals. xterm is a terminal emulator for systems running the x-window system and a graphical user interface. It provides only a single terminal, typically running a single process (an interactive shell by ...


5

To cancel a print job : List all jobs: lpq Rank Owner/ID Class Job Files Size Time active bob A 11 zarma.txt 8000 10:12:10 Delete the job by it's id, which is 11 here: lprm 11 You must be root to delete jobs that you don't have initiated. If the printer is not the default printer, add the -P option, ...


5

Looking at it from the perspective of what's similar between xterm and screen: First: we're takling about emulations of this kind of real hardware device, a terminal (VT100 in this example): (from Wikimedia commons) xterm emulates one terminal showing it as a GUI window on screen screen emulates multiple terminals, but does not actually emulate the ...


4

COLUMNS is not set somehow in .bashrc. Just get the columns via tput cols like this: dp_smaller_than=80 if [ $(tput cols) -lt $dp_smaller_than ] then PROMPT_COMMAND="degr_prompt" else PROMPT_COMMAND="full_prompt" fi


4

Those are escape sequences to set colors: ←[00;34 tries to turn on blue color ←[00m tries to reset the color It is up to your terminal to interpret those sequences and do the coloring. The real putty brings it's own terminal, which is able to interpret these. If you use plink, you are using your windows terminal, which is not able to do so and simply ...


4

The terminal will start in the working directory it inherits from its parent. However, some allow to override it via configuration settings. With gnome-terminal, you can edit your profile, tick run a custom command instead of my shell and make it: sh -c 'cd ~/Documents; exec "${SHELL:-sh}"'


4

You started writing a string literal: everything between ' and the next ' is treated as a single "thing" by the shell, including newlines, spaces, and any other characters. Here you wrote a string containing two newlines. That meant that the first thing on the line was \n\n (two newlines). Because the first thing on a line is always the command to run, the ...


3

remap control : bind -x '"\C-l": clear'


3

The problem is that your variable GREEN contains the literal string consisting of "backslash bracket backslash zero three three" and so on. It does not contain for example an ASCII escape character as required to get your terminal to change colour. You could put control characters into GREEN (and YELLOW and RESET) manually, but a much better option is to ...


3

This is a bit of a complicated question. I'll try to answer your questions in turn, but first a general description: The scrollback buffer is implemented by your terminal emulator (xterm, Konsole, GNOME Terminal). It contains all the text that has been displayed on the screen, including both standard output and standard error from every program you run in ...


3

They are fundamentally different. I think the main difference is: Screen allows you to detach the session and reattach it later from a different place. For example you might have some important process running in your xterm but unfortunately your monitor breaks and you can no longer use your computer. If the process runs in screen you could now 'ssh` into ...


3

You can try rxvt-unicode. It fully conforms all of your listed criterias: really lightweight, on my system it only uses 0.5M memory with multiple instances unicode is fully supported, hence its name fully configurable through the Xresources file, but all configuration options has a corresponding command line option development is active, latest stable ...


2

From the tmux FAQ: ****************************************************************************** * PLEASE NOTE: most display problems are due to incorrect TERM! Before * * reporting problems make SURE that TERM settings are correct inside and * * outside tmux. * * ...


2

Here is a starting point: command | tee >(aplay -r 32000 2> /dev/null &); pkill aplay Try it with dmesg or ls -l /usr/bin to test. (Set your volume low first) Tee simply splits output to two places. There is a pkill aplay so that the sound ends when the command exits. Adjust the rate (-r 32000) to make it higher or lower. Note that this is very ...


1

The terminal emulation is baked pretty deep into the design of mosh, so, no. Mosh works by having both client and server each maintain its local idea of what the screen currently "looks like", and that requires that the server does terminal emulation. This is how the client is able to refresh the contents of the screen after it has been away for a while and ...


1

If you really want to set all the resources to a particular IP address, you can achieve it using tc command. But is it worth spending the time on it, it's upto you. :) From man page of tc command, Description Tc is used to configure Traffic Control in the Linux kernel. Traffic Control consists of the following: SHAPING When traffic is ...


1

As michas has explained, those are terminal escape sequences. How they are interpreted is up to the terminal. You can do as michas has suggested and call ls like \ls, which will call the ls executable in $PATH, instead of the common shell alias ls --color=auto. To remove that shell alias you could do: unalias ls You can also add the option... ls ${opts} ...


1

5,6) 9pins is usually enough, the extra pins are secondary data or extra hand shake. The minimum number of pins/wires is 3: ground (gnd), transmit(tx) and receive(rx). It is better to have more handshaking: clear to send and request to send, then a bit better is to add data set ready, data terminal ready. Note the biggest misunderstanding in rs232 is the ...


1

One workaround is using (remotely accessed) scratch files to transfer the text: In case you can SSH back to your own system, you can just :split scp://hostname/path/to/file, put the yanked text there, and :write. If you can just use SSH from your system to the server box, open Vim locally and access the scratch file from the server: vim ...


1

Change the way you fill $GREEN, $YELLOW and $RESET: GREEN="$(echo -e "\033[32m")" YELLOW="$(echo -e "\033[33m")" RESET="$(echo -e "\033[0m")" PS1='\u@\h:\w${YELLOW}$(virtual_env)${GREEN}$(git_branch)${RESET}$ '


1

This seems to be a question with the XY-problem - it's not asking the right thing to get the desired solution: Assume the output is colored, and the empty part of the screen is of different color or filled with a character. Think about how you expect the output to look for these cases: An empty line? Lines filled with only space characters? Lines ...


1

It switching because something is detecting the change and setting up the mouse again. (So things go back to default) To stop the behavior you need to add your settings to an Input section in x11.conf so that when it is "re-initilized" the defaults are what you want. The settings your looking for are: Option "MinSpeed" "X.xx" # speed factor for ...


1

Add echo ----++++some stuff++++---- to your .bashrc. You might want to have /etc/motd modified as well. This message will be shown every time you successfully log in.



Only top voted, non community-wiki answers of a minimum length are eligible