Skip to content

Commit

Permalink
prompt: fix a bug that "\u" is expanded to the shell name
Browse files Browse the repository at this point in the history
  • Loading branch information
akinomyoga committed Feb 27, 2023
1 parent e2ec89c commit fe339c3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions docs/ChangeLog.md
Expand Up @@ -105,6 +105,7 @@
- util (blehook): support `hook!=handler` and `hook+-=handler` `#D1791` 0b8c097
- prompt: escape control characters in `\w` and `\W` `#D1798` 8940434 a9551e5
- prompt: fix wrongly escaped UTF-8 chars in `\w` and `\W` `#D1806` d340233
- prompt: fix a bug that `\u` is expanded to the shell name `#D1975` xxxxxxx
- emacs: support `bleopt keymap_emacs_mode_string_multiline` (motivated by ArianaAsl) `#D1818` 8e9d273
- util: synchronize rlvars with `bleopt complete_{menu_color{,_match},skip_matched} term_bracketed_paste_mode` (motivated by ArianaAsl) `#D1819` 6d20f51
- util: suppress false warnings of `bind` inside non-interactive shells (reported by wukuan405) `#D1823` 1e19a67
Expand Down
14 changes: 7 additions & 7 deletions note.txt
Expand Up @@ -1942,13 +1942,6 @@ bash_tips
- keymap の移動 (これは別 commit にする?)
- make_command.sh の整理 (scan 分離, char_width 分離)

2023-02-19

* cygwin: sudo すると PS1 の \u が bash に化けてしまう。何故?

PS1='\u' だと発生しない。 PS1='\u\$ ' だと発生する。Cygwin では '\$' を特別
視してこれが含まれている時には自前処理している。

2023-02-12

* syntax: 5.0 以降では関数名として function `xxx` 等も実は許されている。5.3
Expand Down Expand Up @@ -6597,6 +6590,13 @@ bash_tips

2023-02-20

* cygwin: sudo すると PS1 の \u が bash に化けてしまう。何故? [#D1975]

PS1='\u' だと発生しない。 PS1='\u\$ ' だと発生する。Cygwin では '\$' を特別
視してこれが含まれている時には自前処理している。

何と \s で展開していた。これは a9551e54 (2022-03-12 #D1801) で導入されている。

* 2022-06-09 macOS の nawk の振る舞いが変だという事 (reported in killermoehre) [#D1974]
https://github.com/akinomyoga/ble.sh/issues/190

Expand Down
2 changes: 1 addition & 1 deletion src/edit.sh
Expand Up @@ -597,7 +597,7 @@ function ble/prompt/initialize {
_ble_prompt_const_s=$ret

# user
ble/prompt/.initialize-constant '\s' 'ret=${USER:-$_ble_base_env_USER}' escape
ble/prompt/.initialize-constant '\u' 'ret=${USER:-$_ble_base_env_USER}' escape
_ble_prompt_const_u=$ret

# bash versions
Expand Down

0 comments on commit fe339c3

Please sign in to comment.