prompt is a command-line or graphical interface which presents the user with a line editor or modal dialog and suspends execution until input is returned
Questions tagged [prompt]
2321 questions
31
votes
4 answers
Where exactly Git Bash for Windows' prompt is defined?
Both my office and home computers have Git Bash for Windows from the very same source (Git for Windows, that came with TortoiseGit), but Git Bash's prompt differs on both machines:
on office computer I have /c/path (branch) all green (this is, how…

trejder
- 17,148
- 27
- 124
- 216
30
votes
2 answers
How to insert an environment variable inside the bash prompt
I can set an environment variable inside the bash prompt like this:
export PS1="[\u@\H/$FOO \W]\$ "
The prompt does not change when I change the environment variable: $FOO because the $FOO variable is not interpreted.
I can work around it by doing…

Bernd
- 1,201
- 3
- 12
- 10
30
votes
3 answers
Suppress the passphrase prompt in GPG command
Edited Version
I have a question about GPG, but I write all of the process, maybe it will help someone.
I want to: Suppress the passphrase prompt in GPG command. I don't want to: use -c option (--symmetric).
I have 2 systems Linux and Windows. I…

Malus Jan
- 1,860
- 2
- 22
- 26
29
votes
3 answers
JavaScript dialogs alert(), confirm() and prompt() in cross origin iframe does not work any longer
Apps script web app works in

JFtyv_85StvsDpDn
- 318
- 1
- 3
- 7
26
votes
3 answers
How can I make an expect script prompt for a password?
I have an expect script that connects to a few routers through ssh. All these routers have the same password (I know, it's wrong), and the script needs to know that password in order to be able to connect to the routers. Currently, the password is…

MiniQuark
- 46,633
- 36
- 147
- 183
26
votes
6 answers
Color for the PROMPT (just the PROMPT proper) in cmd.exe and PowerShell?
So in Bash you just configure PS1 to add colors to your prompt. I'm talking about the prompt proper, not the color of the foreground (text) or the background. And it's really easy in Bash and it helps a lot if you need to find your commands in a sea…

Lumi
- 14,775
- 8
- 59
- 92
25
votes
16 answers
SweetAlert prompt with two input fields
Currently working on a personal project. I want the user to click a button and a SweetAlert prompt would be presented for the user to verify their credential. However, the code I see on the SweetAlert website only allows one input field. Here is the…

ballerz
- 467
- 3
- 6
- 15
24
votes
5 answers
CMD command to check connected USB devices
I would like to obtain by a command prompt a list of all USB devices connected to my computer (O.S. Windows 10). I've googled to find such a command, but all results seems useless to me or worse workless. Does anybody know how can I do that?
Thank…

Luca
- 243
- 1
- 2
- 5
22
votes
6 answers
How to print current bash prompt?
The question is simple. I want to evaluate current value of PS1 in my bash script.
All materials on google point to tutorials on pimping it up, but I want to evaluate to see how would it be rendered by my current terminal, or at least by some…

Piotr Zierhoffer
- 5,005
- 1
- 38
- 59
22
votes
5 answers
kill iOS Simulator from terminal
I'm trying to terminate the iOS Simulator from the terminal console (needed for integrating automatic UI Testing in Jenkins),but every time I try the command:
killall SimulatorBridge
a prompt waiting for action gets displayed:
The problem is that…

Claus
- 5,662
- 10
- 77
- 118
21
votes
5 answers
Code challenge: Bash prompt path shortener
I implemented a prompt path shortener for bash to be included in the PS1 environment variable, which shortens the working directory into something more compact but still descriptive. I'm curious what other ideas may exist.
Here's the…

hurikhan77
- 5,881
- 3
- 32
- 47
20
votes
3 answers
Constantly updated clock in zsh prompt?
I know that I can exec a date command in my zsh prompt.
However, it shows the old time; to see the current time, I have to hit and get a new prompt with the current time.
Is there a way to configure the zsh prompt to constantly update…

anon
- 41,035
- 53
- 197
- 293
20
votes
1 answer
Search for a string in command line output
I want to search for the string "virtual" in "system model" attribute of 'sysinfo' command. The command should be successful if 'virtual' is found in the 'system model: -------------------------' i.e. output of the systeminfo. It should not search…

Ramesh
- 499
- 4
- 10
- 17
19
votes
1 answer
javascript prompt - adding variable in default text
For javascript prompt:
prompt("Message", "default value in the text field");
is it possible to add a variable into the default value?
For example:
var default = 'default value';
prompt("Message", +default+"and other values");
The above example…
John See
19
votes
3 answers
Configure shell to always print prompt on new line, like zsh
If a command's output does not end with a \n, the next prompt appears, awkwardly, immediately afterwards:
$ echo -n hai
hai$
I just noticed a colleague whose shell (zsh, for what it's worth) is configured to print a % (with background and…

davidchambers
- 23,918
- 16
- 76
- 105