Questions tagged [prompt]

A string of characters displayed by interactive shells to signal the shell is waiting a user input.

Filter by
Sorted by
Tagged with
0
votes
0answers
14 views

How to separate all folders containing flac files and mp3 files in windows 10 [closed]

I have a large music collection and I want to separate the lossless flac files from the mp3 files for ease of copying However, I want to retain the artist/album/song directory structure they were ...
3
votes
4answers
1k views

preventing terminal prompt from being overwritten by program output

Suppose I run a command like this in the terminal: ~$ echo 'sleep 2; echo "hello!"' | sh then start typing the next line. After two seconds the words "hello!\n" will be inserted into whatever I'm ...
0
votes
1answer
46 views

My terminal has stopped sourcing my .profile file

I installed starship (https://starship.rs/) the other day to make my prompt more useful, and as cool as it is, it broke a number of things about my terminal so I uninstalled it. Unfortunately, even ...
2
votes
2answers
26 views

How to include my virtual console ID in the prompt, in FreeBSD

When I use virtual consoles ALT-F<1~n> in FreeBSD, I want my 'zsh', 'sh' (and possibly other shells) startup scripts to include the virtual console number in the prompt, if it's not the default ...
1
vote
4answers
989 views

How to change linux terminal prompt to match ParrotOS

I know that terminal prompt can be changed using PS1="prefix" and I know how to set it permanently, that is not a problem. I am just wondering, how would I set it to look like in parrot OS? ...
4
votes
3answers
3k views

Is there any way to test out PS1 Bash Prompts before committing them?

I'd like to mess with my Bash prompt, but I'd like to do so in a way that doesn't corrupt my already extant one. I could just comment it out, but is there a way to test it either with an online tool ...
14
votes
1answer
19k views

How do I ask password by GUI prompt while using sudo in script?

I use Trisquel GNU/Linux with GNOME Flashback Desktop Environment. I need a GUI password prompt for user for executing command with sudo in script. Example consider following script: zenity --...
0
votes
0answers
16 views

creating a command regarding FastANI output?

This question is regarding fastANI of working on metagenomics, using fastANI. I have calculated the average nucleotide identity using 25 samples as REFERENCE and the same 25 samples as QUERY. I have ...
0
votes
1answer
47 views

Can a unicode character be used for the zsh prompt instead of the '%' symbol?

Macbooks now default to zsh for new users. Existing users have the option of switching to it. I've made the switch and would like to make my prompt look the way it did in bash. I have this for the ...
0
votes
2answers
21 views

Launch new terminal instance with zsh using custom prompt string

I want to be able to launch a terminal emulator (preferably gnome-terminal) with interactive zsh running inside using a custom prompt string. I don't want to modify my default prompt string in .zshrc ...
2
votes
1answer
37 views

Terminal fish prompt blank

So I'm trying to change my fish shell terminal prompt but every time I change anything too complicated (beyond colour changes and rearranging the prompt), it just turns up blank. I'm running Arch ...
1
vote
2answers
739 views

How to check PIPESTATUS equivalent during PROMPT_COMMAND execution?

I have a custom $PROMPT_COMMAND in bash that logs the last executed command and its return code. I was using $? for the latter happily until I realized that for piped commands this was insufficient. I ...
4
votes
2answers
891 views

Bash: show prompts if arguments weren't provided

What is the best way of supporting in the script prompts and arguments at the same time? I want to show prompts if arguments weren't provided. Is there something better/shorter than this? ⇩ ...
3
votes
2answers
3k views

How can I get KornShell to display the date and time in the prompt?

On my AIX box, which is using ksh as the default shell, I'd like the prompt to show both the date and time followed by a newline \n, along with the name of the machine, and the working directory. ...
1
vote
1answer
38 views

Difference between %F{color} and %{$fg[color]%} in zsh prompt

I noticed that there are two ways of setting the foreground color in your zsh prompt. PROMPT='%F{blue}$' PROMPT='%{$fg[blue]%}$' Both of these lines will produce a blue $ as your prompt. Is there ...
0
votes
1answer
20 views

How do I get different colored prompt depending on server?

I use ssh all the time, but I sometimes forget which server I am on. Can I using the same .bashrc (/home is NFS shared) have different colored prompt on different servers? Preferably without listing ...
2
votes
1answer
2k views

How to stop execution of command from prompt in shell?

My prompt contains some info about git repo under current directory. When I do cd somewhere, my shell executes some commands (i.e. git status). Is there a way to stop execution of such commands via ...
0
votes
1answer
44 views

Does Korn shell have an equivalent feature to Bash's command_not_found_handle?

And does Korn shell have an equivalent to PROMPT_COMMAND? In Bash, I'm able to make function calls with a parameter when a single input word matches a regular expression. Can Korn shell do this? Let'...
35
votes
1answer
20k views

In which situations are PS2, PS3, PS4 used as the prompt?

When I log on into the shell I see the prompt whose value is stored in PS1. I also encountered another prompt (but do not know which one) when I used the here-document syntax: bc << HERE > ...
2
votes
1answer
784 views

Command substitution not occurring for PS1 variable in zsh

I'm having the hardest time trying to get dynamically evaluated command output in my PS1 prompt with zsh on Ubuntu 17.10. Here are a few attempts I've made (I begin in directory /abc, and the prompt ...
11
votes
3answers
7k views

tmux not colorizing PS1 prompt

I recently decided to change my PS1 variable to accommodate some pretty Solarized colors for my terminal viewing pleasure. When not in a tmux session, everything is great! Rainbows, ponies, unicorns ...
2
votes
4answers
5k views

Changing title without changing prompt on Cygwin

I have the following shell script function from this site that allows me to change the title in both Putty and Cygwin. In Putty connected to a Linux host it changes the title and leaves the prompt as ...
0
votes
0answers
17 views

PS1 possibly making Bash text wrap to same line [duplicate]

I just configured my .bashrc file (PS1) to get a fancier bash prompt and now I have an issue, all my text is wrapping to the same line in the terminal here is my PS1: PS1='${debian_chroot:+($...
0
votes
1answer
36 views

Unicode character in PS1 makes wrapping behave weirdly (not a duplicate)

I wanted to put the Unicode character Δ into PS1, but when I did, when typing in long commands, the terminal wouldn't wrap to a newline but would overwrite the current line! The problem doesn't occur ...
0
votes
0answers
23 views

Long commands typed in bash overwrite the same line Centos Minimal [duplicate]

Long commands typed in bash overwrite the same line its happens when I install Centos Minimal with gui its working as expected. for example this command " rpm -ivh https://repo.zabbix.com/zabbix/4.4/...
0
votes
1answer
31 views

Transcribe bash to zsh

I was wondering how could I write this: export PS1="\[\033[38;5;51m\]\u\[$(tput sgr0)\]\[\033[38;5;15m\]@\[$(tput sgr0)\]\[\033[38;5;10m\]\h\[$(tput sgr0)\]\[\033[38;5;226m\]\w\[$(tput sgr0)\]\[\033[...
1
vote
0answers
27 views

User defined functions in zsh prompt

I'm trying to use a functions that returns the number of commits in a given branch in the zsh prompt. This is what I have now: setopt PROMPT_SUBST autoload -Uz vcs_info precmd() { vcs_info } zstyle ':...
1
vote
1answer
43 views

What is this password prompt after logging in to Debian 9?

Every time I restart the system and log in, a password prompt pops up: In most cases, this happens as soon as I open Chromium (it actually seems to freeze up the browser), and usually clicking on "...
0
votes
1answer
1k views

TCSH Prompt Displays Syntax Error Regarding Missing Bracket

I have set the prompt on my machine using the following code: set prompt = " %B%{\033[34m%}`hostname`: %c %D/%w %p :) %b" It outputs my preferred customized display . It looks like : However when I ...
1
vote
2answers
31 views

Cropping long strings in zsh

I would like to set my prompt to something like %1~ \#, which would show the current directory, without the full path (followed by % or #). But, if the name of the directory is long, I don't want all ...
2
votes
1answer
1k views

My bash prompt is not working in `screen`

On RedHat, screen resets my bash prompt. I set PS1=\u@\h:\w in ~/.bashrc and ~/.bash_profile. I added shell -$SHELL as well to ~/.screenrc. But, when I open a brand new terminal window, the prompt ...
1
vote
1answer
37 views

Is it possible to make mksh use the tilde (~) for home in the PS1?

for example, instead of displaying user@hostname:/home/user in the prompt as per the example in the manpage, could one make mksh display user@hostname:~ ?
0
votes
0answers
11 views

Python venv module cannot add virtual environment name to PS1, when using PROMPT_COMMAND?

I use the official Git Bash prompt support for displaying the current branch as part of the prompt. My problem is that activating a Python virtual environment (python -m venv <dir>) using ...
0
votes
0answers
56 views

How can I enable colours in ZSH for root user?

I'm trying to move from Bash to ZSH, whichc is the new default shell on Mac OS Catalina. I have some bash settings in my profile, and I'd like to translate these settings into the ZSH, including my ...
12
votes
4answers
1k views

tell if last command was empty in PROMPT_COMMAND

In bash, from inside PROMPT_COMMAND, is there a way to tell if the user just hit 'return' and didn't enter a command?
5
votes
2answers
2k views

Difficult authorized_keys login problem only for root on Solaris 11

Here's a difficult ssh problem I can't figure out on Solaris 11, although I think I'm an experienced UNIX/Linux sysadmin. :) I've copied the root@server1:/root/.ssh/id_rsa.pub file to: root@server2:/...
24
votes
7answers
41k views

How can I change what's displayed at a login shell?

I'm getting more familiar with tweaking the way things look in a shell via the prompt (.bashrc), but I'm now trying to change the initial stuff displayed when I first log in. On my EC2 instance, this ...
0
votes
1answer
21 views

Where customize prompt for all existing and new users?

I'm using Ubuntu 18.04. To customize the prompt of an user I know that I have to edit ~/.bashrc. But to override the ~/.bashrc of all existing users which file should I edit on /etc ? And if I want ...
1
vote
1answer
84 views

zsh script prompt reading single keystroke: add newline when appropriate?

I have a script that takes an -i flag (→ $interactive) and if set, asks a yes/no-default-no question for each target, à la rm -i and others. Zsh’s read -q is designed for this exact case—it accepts a ...
4
votes
2answers
864 views

A status bar at bottom of terminal in place of PS1

It occurred to me that when I'm doing stuff in the terminal my PS1 is repeated several times for each command. My PS1 includes CWD and git branch so it can get reasonably long. Is there a way I can ...
2
votes
1answer
109 views

Zsh: timeout for vared builtin

I've got a while loop that uses vared to prompt for user input. I am looking for a way to have it timeout, execute a default variable and loop back to the prompt if there is not user input after a ...
1
vote
1answer
232 views

Instead of username bash-4.2$ is displayed. How can I resolved that?

After connecting to the server through SSH command in Linux ssh: IP address. In my server terminal changed to bash-4.2$. If I try to connect from Putty in windows it connects but shows this -bash: /...
1
vote
1answer
422 views

oh-my-zsh's prompt is slow: how to fix this

I'm using macOS 10.15.2 with iTerm2, zsh 5.7.1 and oh-my-zsh (theme robbyrussell). I noticed that the prompt print is slightly slow respect to the bash one. For example, if I press enter, cursor ...
0
votes
1answer
39 views

Login prompt's weird behaviour

In TTY, my login prompt has got a strange and annoying behaviour: with my arrow keys, I can move the cursor everywhere on the screen, including the prompt itself, the welcome message, etc. If I press ...
1
vote
1answer
445 views

How can I display the insert mode prompt on the left when using zsh with the in vi-mode plugin?

I am using zsh with command-line editing using vi-mode and it displays the right hand prompt as <<< when in vi's INSERT mode. Is there a way to display or add it to the right prompt? The vi-...
0
votes
1answer
58 views

Unix - can i make the command line readable? [duplicate]

Let's say I have this commandline: ~/development/company/folder: and i run this command ./gradlew appRun then my command line looks like this: ~/development/company/folder: ./gradlew appRun Now, ...
21
votes
6answers
16k views

How to make bash put prompt on a new line after cat command?

What I get: host:~ user$ cat example.txt some texthost:~ stas$ What I want to get: host:~ user$ cat example.txt some text host:~ stas$ Is there a way I can make cat behave like this? I'm using ...
0
votes
2answers
37 views

extra characters in bash prompt

I have been trying to customize my bash prompt below is my config #!bin/bash Nocolor="\[\033[0m\]" # Text Reset # Bold High Intensty BIBlack="\[\033[1;90m\]" # Black BIRed="\[\033[1;91m\]...
0
votes
1answer
50 views

bash prompt wrapping to start of line

I was trying to add some color and the time to my PS1 prompt on Debian 10 in my ~/.bashrc file. It initially looks right, but if I type a line that's more than about 40 characters the cursor moves to ...
1
vote
0answers
49 views

How to show how many times bash has been invoked? [duplicate]

A lot of times I will used wrapper scripts for projects to maintain environment variables during development; shell.sh: #!/bin/bash export PATH=$PWD/bin:$PATH export USERNAME=foo export PASSWORD=...

1
2 3 4 5
11