From 76e1cda495d6e88cea383d387375588cdf9297bc Mon Sep 17 00:00:00 2001 From: maxfl Date: Sat, 7 Jul 2012 10:17:24 +0800 Subject: [PATCH] Set single-line default prompt Fish now doesn't join the fish_prompt output. This breaks the default fish_prompt. Make default fish_prompt single-line. Fixes #203. Add -l flag to 'read' documentation. Remove ambiguous '-x' description. Fixes #157. --- doc_src/read.txt | 2 +- reader.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc_src/read.txt b/doc_src/read.txt index b85b5fd8f..d69d715b7 100644 --- a/doc_src/read.txt +++ b/doc_src/read.txt @@ -9,8 +9,8 @@ The read builtin causes fish to read one line from standard input and store the result in one or more environment variables. - -c CMD or --command=CMD specifies that the initial string in the interactive mode command buffer should be CMD. -- -e or --export specifies that the variables will be exported to subshells. - -g or --global specifies that the variables will be made global. +- -l or --local specifies that the variables will be made local. - -m NAME or --mode-name=NAME specifies that the name NAME should be used to save/load the history file. If NAME is fish, the regular fish history will be available. - -p PROMPT_CMD or --prompt=PROMPT_CMD specifies that the output of the shell command PROMPT_CMD should be used as the prompt for the interactive mode prompt. The default prompt command is set_color green; echo read; set_color normal; echo "> ". - -s or --shell Use syntax highlighting, tab completions and command termination suitable for entering shellscript code diff --git a/reader.cpp b/reader.cpp index 29645d74b..ba275f54d 100644 --- a/reader.cpp +++ b/reader.cpp @@ -118,7 +118,7 @@ commence. fish specific commands, meaning it will work even if fish is not installed. This is used by read_i. */ -#define DEFAULT_PROMPT L"echo \"$USER@\"; hostname|cut -d . -f 1; echo \" \"; pwd; printf '> ';" +#define DEFAULT_PROMPT L"echo -n \"$USER@\"(hostname|cut -d . -f 1)' '(pwd)'> '" /** The name of the function that prints the fish prompt