The prompt is what asks a user for their interactive input

learn more… | top users | synonyms

8
votes
1answer
4k views

How can I put a newline in my zsh prompt without causing terminal redraw issues?

I'm trying to fix a minor (but annoying) issue with my zsh prompt. The problem I'm seeing is that when I'm using a terminal in a GUI OS environment (for example, Terminal.app or iTerm 2 on OS X ...
4
votes
2answers
459 views

Why does this bash prompt sometimes keep part of previous commands when scrolling history?

My bash prompt, which I'll admit to have stolen from a few places and cobbled together, will sometimes add part of previous commands to its length when scrolling the bash history with up/down arrows. ...
2
votes
2answers
6k views

modify login prompt or header (/etc/issue) to display ip address of the machine

I work with a lot of virtual machines. For testing and preproduction set up. I would like the login promt or header to display the ip address of the machine. That way when I start it up I can see ...
1
vote
1answer
401 views

How can I remove new line character in prompt?

As you can see in the screenshot, I have an unneeded newline character in my prompt. Anyone know how to do remove this character from my prompt?
1
vote
2answers
369 views

Bash prompt output colors change after first 2 lines of output

I customized my bash PS1 prompt with this ~/.bashrc file. I can't seem to figure out why my output colors change after the first 2 lines of output. Any ideas what could be causing the issue?
0
votes
3answers
714 views

How do I change the default prompt from “#” to “>”?

How can I change the default prompt in Linux (red-hat 5.4) from "#" to ">"? example [root@moon11 root]# to [root@moon11 root]>
11
votes
3answers
3k views

zsh right-justify in ps1

I'd like a multi-line zsh prompt with a right alined part, that will look something like this: 2.nate@host:/current/dir 16:00 -> I know about ...
3
votes
1answer
2k views

How do I change shell prompt permanently?

I use PS=$ to change the shell prompt to $, but when I restart the shell, I have to do it again. Is there a way to change the shell prompt permanently?
1
vote
2answers
1k views

How to fix my bash prompt with long lines?

I have the following bash prompt: YELLOW="\[\033[0;33m\]" GREEN="\[\033[0;32m\]" RESET='\e[0m' export PS1="$GREEN[\W]$YELLOW \$(__git_ps1 \"(%s) \")$RESET\\$ " It looks like this: Which is what ...
6
votes
1answer
384 views

Custom prompt botched during history and control-a in OS X's Terminal.app using Bash

I customized my prompt in .bash_profile to look like this: export PS1="\w \e[0;32m\$(vcprompt -f '[%n:%b]')\e[m\$ " Now, when I press up arrow to go back through history, find the one I want, then ...
1
vote
3answers
531 views

How can I view all the results outputted to the Command Prompt?

The output from running aircrack-ng shows all the packets from the capture file, but I'm unable to view the top of this output, only the last 150 lines. I need to view the top in order to find the ...
3
votes
2answers
2k views

~/.profile not being executed when Terminal opens? [OS X 10.6.8]

Somehow my bash prompt got changed to "elementary:~ steven$" and I want to change it back to the default prompt. I've added the following first to ~/.bashrc then to ~/.profile: export PS1="\s-\v\$ " ...
1
vote
2answers
1k views

Mac OS X Lion terminal places command prompt in the middle of PS1 envvar

Before I installed Lion opening a terminal window placed the cursor at the end of the prompt like so: Wed Aug 31{shirsch4@Susan-Hirschs-iMac}/projects/perl/perl/lib/Utils--><cursor> Now ...
5
votes
3answers
4k views

Windows 7 batch file: Why are these IF blocks keeping me from assigning variables to a value?

Here's the broken batch file: @echo off if prod==prod ( if xps==xps ( set i1=prodxpsi1 set i2=prodxpsi2 set e1=prodxpse1 set e2=prodxpse2 ) else ( set ...
0
votes
1answer
162 views

Does the non-printing characters escape characters still needed for PS1 definition?

While modifying the definition of my PS1, I saw that "\[" and "\]" markers should be added to help bash to compute the right display lenght. Many exemples on the web do not use them or even mention ...
4
votes
1answer
2k views

tmux: sharing current window title (#T) from within nested tmux sessions

I have begun using tmux recently to really improve my terminal sessions. One thing I need to be able to do is connect to a remote server, which is also running tmux. However, I have found that the ...
12
votes
3answers
7k views

How do I hide the path in command line prompt on Windows?

I'm working on Windows 7 using the cmd console. How do I hide the path in the prompt?
0
votes
1answer
211 views

FreeBSD 8.2: Keystrokes in Bash do not show up

I just installed the latest FreeBSD 8.2 distro using Parallels Desktop. Problem: Whatever I type in the Bash/Shell it is not echoed on the screen. It's behaving like a password prompt. As soon I hit ...
2
votes
1answer
1k views

Kaspersky 2012 Firewall - prompt on new connection attempts

How can I get Kaspersky 2012 Firewall to ask me everytime if I want to allow or deny an application to connect to the internet the first time it asks and have it remember that until the application ...
30
votes
3answers
8k views

Tmux and ZSH custom prompt : bug with window name

I have customized my ZSH prompt with oh-my-zsh to make it more readable and add information about git if I'm in a repository. Example : bob@inf [~/docs] % bob@inf [~/src/nicest] master % (in a git ...
11
votes
2answers
2k views

Escape non-printing characters in a function for a Bash prompt

In a Bash Prompt (PS1 variable), I'm calling a function to potentially add text to the prompt: export PS1="\u@\h \$(my_function) \$ " However, the function in the prompt contains ANSI color codes ...
12
votes
3answers
3k views

Making Linux shell prompt show last return value

I'm currently on a Linux machine and the shell prompt is showing me the last return value and number of executed commands (picture included, with these numbers shown in purple). My own computer ...
1
vote
1answer
173 views

Bash Prompt Loses Characters

After writing a new prompt for Bash, I noticed that one character of my commands were being lost when it wrapped to the new line. Here is an image of the example (I typed 1234567890 over and over): ...
5
votes
2answers
445 views

Is it possible to get bash to display the first letter of each directory in my working path?

For example working in: /home/stuart/src/project/com/example/package /usr/lib/python2.6 would appear as: ~/s/p/c/e/package$ /u/l/python2.6$
0
votes
1answer
3k views

Running 2 explorer.exe instances with the “RunAs” Command

I've created 2 batch files. The first called admin.bat with the lines: @echo off cls runas /env /user:ADOMAIN\Administrator "\\path\dir\explorer.bat" and the other called explorer.bat with the ...
0
votes
2answers
1k views

See error code in bat file

In windows prompt i am launching an app. I'd like to see the error code it returns. How do i display it?
1
vote
1answer
363 views

Bash prompt breakdown

Can anyone explain the Ubuntu's bash prompt? It's basically username@box:~$ but the part that confuses me is $. Is it just a letter that can be of preference, or it has some actual meaning?
4
votes
2answers
401 views

Do I need to enclose ANSI escape sequences in \[ and \] in a bash prompt?

I want to customize my bash prompt using ANSI escape codes and have noticed that in some howtos the codes are enclosed in \[ and \] while in others they aren't. For example, these work equally well ...
3
votes
1answer
1k views

Bash command prompt overwrites the current line

My bash command prompt is: \e[32;1m[\e[m\h.\u \e[33;1m\W\e[m\e[32;1m]\e[0;36m::\e[m There must be something wrong with it, because on long lines, the current line is overwritten, instead of ...
2
votes
2answers
927 views

Determine/resolve filepath/alias of a certain command in the Windows command prompt

How can I find out to which filepath (or alias) a certain command input will point to, in the Windows command prompt? Specifically Windows XP, info on other versions also appreciated! On Unix systems ...
1
vote
2answers
482 views

In GNU Screen, Recalled bash history command displays one character position to the left of actual location

I am running Red Hat 5 32-bit (2.6.18-194.26.1.el5). The issue is that when I recall any previous command in bash's history, the first character in the command is displayed immediately after the ...
0
votes
1answer
3k views

disable possword policy using command prompt in Server 2008

Is there a way to disable password policy in Windows Server 2008 using command prompt. I know how to do it using Local Security Policy in Administrative Tools. I was wondering if there is a way to ...
4
votes
1answer
103 views

Force prompt on specific directories

Is there a way to change the prompt on a different directories on the same machine? For example, I want a simple prompt "[\W] \$" in development directories. Ideas?
1
vote
1answer
1k views

No Telnet login prompt when used over SSH tunnel

I have a device, let's call it d1, runnning a lightweight Linux. This device is NATed by my internet box/router, hence not reachable from the Internet. That device runs a telnet daemon on it, and only ...
36
votes
3answers
20k views

OpenSSL without prompt

I am using following code to generate keys: apt-get -qq -y install openssl; mkdir -p /etc/apache2/ssl; openssl genrsa -des3 -out server.key 1024; openssl req -new -key server.key -out server.csr; cp ...
10
votes
8answers
5k views

Pushing my PS1 prompt over ssh

I use a specific PS1 prompt that I like. I share a few logins with other other people on a few different servers. I was wondering if there was a way to specify in my local bash profile a remote prompt ...
7
votes
3answers
5k views

Lightning bolt for prompt (PS1)

I've seen on a few screencasts a while back where someone had a lightning bolt instead of $ on the bash prompt. Does anyone know how to do this?
2
votes
1answer
2k views

How to correctly set GNU Screen to display currently running program in hardstatus

In bash, to display the name of the current program in the GNU Screen hardstatus line takes only two configuration lines. First, tell screen what the end of your prompt normally looks like, and supply ...
2
votes
1answer
358 views

How can I minimise my Bash shell prompt?

Currently the terminal prompt looks like this: [karlis@karlis-desktop current_folder]$ How can I minimize the prompt, so that it only shows $ or # without extra info in square brackets? I checked ...
13
votes
5answers
28k views

How can I display the absolute path in bash prompt?

I currently have my bash PS1 set to something like this: PS1="\[\`if [[ \$? = "0" ]]; then echo '\e[32m\h\e[0m'; else echo '\e[31m\h\e[0m' ; fi\`:\w\n\$ " How can I make it show the absolute path ...
1
vote
2answers
465 views

How to highlight current folder in Bash prompt?

I'd like to use the \w variable in .bashrc, but I want the prompt to highlight the current end-directory. Something like this: /usr/local/<strong>bin</strong> How can I do that?
9
votes
3answers
22k views

How to Run an app as Administrator without the prompt?

When I start SQL Server Management Studio 2008, I an error that's been around forever and is documented here. One of the suggestions to fix it that actually worked was to start SSMS with Run as ...
3
votes
2answers
2k views

How to make bash update its idea of hostname

My bash prompt shows my hostname. If I change my hostname with the hostname command, in /etc/hosts, /etc/hostname and $HOSTNAME, the prompt still uses the old name. Is it possible to update this ...
0
votes
1answer
215 views

Command line Bin to local Printer

I am trying to run a bin file from the command prompt to a local printer connected via usb. The line I am using is: C:\Users\Administrator>rundll32 printui.dll,PrintUIEntry /b PAItx2002f /a %windi ...
1
vote
1answer
2k views

Execute remote shell commands on windows XP embedded

The following situation: We have Windows XP Embedded clients that have all admin shares disabled and only have read-only shares (for security reasons). What we want to do is run remote shell (dos) ...
3
votes
1answer
242 views

Why is my bash prompt repeating its last line twice, when I ls, or cd or issue misc commands?

My prompt is such: PS1="\[\033[32m\]\u@myserver\n\[\033[33m\w$\033[0m\] " So as output after I ls i see this: jake@myserver ~/public_html$ ~/public_html$ When I should only (I think) see: ...
1
vote
1answer
592 views

ANSI prompts messed in Ubuntu 10.04 terminal window (Unicode 0002), but ok in Putty

My bash prompt is: PS1='\e[1;31m\]\[\u\e[0m\]@\h [\e[1;33m\]\w\[\e[0m\]]\$ ' (reddish username, yellowish current directory). If I connect with Putty from a Windows machine, everything is fine. If ...
2
votes
1answer
214 views

'sourcing' from the bash prompt

I have a little script that sets my proxy system wide in one go, it calls gconftool-2, sets a proxy in ~/.ssh/config and sets the proxy for apt. This is all relatively simple. The real problem comes ...
0
votes
2answers
120 views

How do I add history/reverse_matching feature to windows prompt?

In linux prompt,we can type !mysql and so on to match a history command to save time. Is there a utility for windows(XP to be exact) that enables this feature?
4
votes
3answers
3k views

Get Function Into PS1 (Zsh)?

This works in Bash (parse_git_branch is a defined function) export PS1="\$(parse_git_branch)" but I cannot figure out the equivalent in zsh. Note: If I do PROMPT="$(parse_git_branch)" it seems ...