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 ...


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

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 ...


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, ...


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

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 ...


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}"'


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

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 ...


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 ...


2

There are at least two applications built in as standard xscreensaver modules that do some of this already - they're actual terminal emulators in their own right. One is phosphor and the other is apple2. On my machine I can, for instance: /usr/lib/xscreensaver/apple2 -text -fast -program /usr/bin/sh And the xscreensaver module opens its own pty for sh ...


1

Yes and no. You can redirect its child's out-stream - your shell - but xterm will have little involvement there. xterm owns the master side of that pty - it does an open on /dev/ptmx and in the process creates /dev/pts/3. But it gives it away - your shell owns that pty now, as xterm makes it the session leader. All xterm does it take the input from the ...


1

This worked for me: cat script_file


1

Terminals are character-cell displays and don't support drawing pixel graphics. Not even when running in X11; although it's certainly possible to draw individual pixels when talking directly to an X server, if your program is talking to a terminal it can only ask the terminal to display characters. To display graphics instead of text, you'll need to write ...


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

Using the dconf-editor you can navigate to: org.pantheon.terminal.settings There are options for window-height and window-width. I had the same problem and found the solution here.


1

You can copy the lines of output without extra newlines (line breaks) if the text was output directly to the terminal. The terminal can keep track of where the real line ends are. But if the lines were output by less or a similar pager program, the terminal does not know where the newlines are. The pager uses the terminal as a full screen of characters, and ...



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