summary refs log tree commit diff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rw-r--r--bin/cash/histedit.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/bin/cash/histedit.c b/bin/cash/histedit.c
index 3c77c6e8..92d8170a 100644
--- a/bin/cash/histedit.c
+++ b/bin/cash/histedit.c
@@ -177,10 +177,26 @@ sethistsize(const char *hs)
 }
 
 void
-setpslit(const char *lit) {
-	if (el != NULL && *lit < 0x20) {
-		el_set(el, EL_PROMPT_ESC, getprompt, *lit);
-		el_set(el, EL_RPROMPT_ESC, getrprompt, *lit);
+setpslit(const char *lit_ch) {
+	wchar_t wc;
+
+	if (!(iflag && editing && el))
+		return;
+
+	if (lit_ch == NULL) {
+		el_set(el, EL_PROMPT, getprompt);
+		el_set(el, EL_RPROMPT, getrprompt);
+		return;
+	}
+
+	mbtowc(&wc, NULL, 1);		/* state init */
+
+	if (mbtowc(&wc, lit_ch, strlen(lit_ch)) <= 0) {
+		el_set(el, EL_PROMPT, getprompt);
+		el_set(el, EL_RPROMPT, getrprompt);
+	} else {
+		el_set(el, EL_PROMPT_ESC, getprompt, (int)wc);
+		el_set(el, EL_RPROMPT_ESC, getrprompt, (int)wc);
 	}
 }
 
2024-09-07/lens?id=49a105101493f4dd51259dd62dcbd24df0909bd3&follow=1'>Add photos from September 7June McEnroe 2024-09-24Allow not having descriptionsJune McEnroe 2024-09-23Automatically select the last used lens for a bodyJune McEnroe 2024-09-19Add photos from September 5June McEnroe 2024-09-15Add some more film stocks to the listJune McEnroe 2024-09-13Add photos from September 2June McEnroe 2024-09-13Add Fomapan 200 to films listJune McEnroe 2024-09-10Add August 29 picnic photosJune McEnroe 2024-09-08Apply some bold to trips renderingJune McEnroe 2024-09-08Render trips hopefully more efficientlyJune McEnroe 2024-09-08Allow removing bodies and lensesJune McEnroe 2024-09-08Limit body width so it looks less silly on desktopJune McEnroe 2024-09-07Handle no film being loadedJune McEnroe 2024-09-07Fancy up the text a littleJune McEnroe