Questions tagged [prompt]

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

2321 questions
1152
votes
9 answers

List all environment variables from the command line

Is it possible to list all environment variables from a Windows' command prompt? Something equivalent to PowerShell's gci env: (or ls env: or dir env:).
Nicola Cossu
  • 54,599
  • 15
  • 92
  • 98
763
votes
16 answers

Run Command Prompt Commands

Is there any way to run command prompt commands from within a C# application? If so how would I do the following: copy /b Image1.jpg + Archive.rar Image2.jpg This basically embeds an RAR file within JPG image. I was just wondering if there was a…
user
  • 16,429
  • 28
  • 80
  • 97
503
votes
14 answers

In Windows cmd, how do I prompt for user input and use the result in another command?

I have a Windows .bat file which I would like to accept user input and then use the results of that input as part of the call to additional commands. For example, I'd like to accept a process ID from the user, and then run jstack against that ID,…
marc
227
votes
12 answers

How can I change the color of my prompt in zsh (different from normal text)?

To recognize better the start and the end of output on a commandline, I want to change the color of my prompt, so that it is visibly different from the programs output. As I use zsh, can anyone give me a hint?
Mnementh
  • 50,487
  • 48
  • 148
  • 202
188
votes
2 answers

Read password from stdin

Scenario: An interactive CLI Python program, that is in need for a password. That means also, there's no GUI solution possible. In bash I could get a password read in without re-prompting it on screen via read -s Is there something similar for…
Boldewyn
  • 81,211
  • 44
  • 156
  • 212
165
votes
6 answers

Have bash script answer interactive prompts

Is it possible to have a bash script automatically handle prompts that would normally be presented to the user with default actions? Currently I am using a bash script to call an in-house tool that will display prompts to the user (prompting for…
TJ L
  • 23,914
  • 7
  • 59
  • 77
151
votes
4 answers

Why doesn't "total" from ls -l add up to total file sizes listed?

Why is the total in the output of ls -l printed as 64 and not 26078 which is the total of all files listed? $ ls -l ~/test/ls total 64 -rw-r--r-- 1 root root 15276 Oct 5 2004 a2ps.cfg -rw-r--r-- 1 root root 2562 Oct 5 …
Sanket Sahu
  • 8,468
  • 10
  • 51
  • 65
150
votes
7 answers

What is the difference between PS1 and PROMPT_COMMAND?

While taking a look at this awesome thread I noticed that some examples use PS1="Blah Blah Blah" and some use PROMPT_COMMAND="Blah Blah Blah" (and some use both) when setting the prompt in a Bash shell. What is the difference between the two? A…
Jed Daniels
  • 24,376
  • 5
  • 24
  • 24
139
votes
11 answers

Prompt Dialog in Windows Forms

I am using System.Windows.Forms but strangely enough don't have the ability to create them. How can I get something like a javascript prompt dialog, without javascript? MessageBox is nice, but there is no way for the user to enter an input. I want…
user420667
  • 6,552
  • 15
  • 51
  • 83
123
votes
9 answers

Different bash prompt for different vi editing mode?

When using vi mode (set -o vi) with Bash, it would be nice to have a prompt that depends on the mode you are currently in (insert or command). How does one find out this editing mode? B.t.w, this seems to be possible in ZSH:
Thomas
105
votes
16 answers

ZSH: Hide computer name in terminal

How would I hide the computer name in the prompt while using the terminal? At the moment it shows both username and computer name like so: It would save some space by removing anwarchoukah@anwars-mbp, seeing as I actually know who I am:)
achoukah
  • 1,345
  • 2
  • 10
  • 10
97
votes
17 answers

Detecting Unsaved Changes

I have a requirement to implement an "Unsaved Changes" prompt in an ASP .Net application. If a user modifies controls on a web form, and attempts to navigate away before saving, a prompt should appear warning them that they have unsaved changes,…
tbreffni
  • 5,082
  • 5
  • 31
  • 30
94
votes
9 answers

To get a prompt which indicates Git-branch in Zsh

I run the following codes separately as my prompt unsuccessfully in .zshrc. This suggests me that apparently I do not have a program called __git_ps1. It is not in MacPorts. #1 PROMPT="$(__git_ps1 " \[\033[1;32m\]…
Léo Léopold Hertz 준영
  • 134,464
  • 179
  • 445
  • 697
93
votes
10 answers

Bash prompt with the last exit code

I've been trying to customize my Bash prompt so that it will look like [feralin@localhost ~]$ _ with colors. I managed to get constant colors (the same colors every time I see the prompt), but I want the username ('feralin') to appear red, instead…
feralin
  • 3,268
  • 3
  • 21
  • 37
92
votes
4 answers

WPF: Create a dialog / prompt

I need to create a Dialog / Prompt including TextBox for user input. My problem is, how to get the text after having confirmed the dialog? Usually I would make a class for this which would save the text in a property. However I want do design the…
stefan.at.kotlin
  • 15,347
  • 38
  • 147
  • 270
1
2 3
99 100