From 45bfeeef21b5207485377a75ce999d0da562448d Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 24 Sep 2023 13:41:16 +0530 Subject: [PATCH] Update FAQ on sudo + terminfo --- docs/faq.rst | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/faq.rst b/docs/faq.rst index 32a5a70f9..20557ebea 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -130,12 +130,15 @@ by running ``sudo visudo`` and adding the following line:: Defaults env_keep += "TERM TERMINFO" -If none of these are suitable for you, you can run sudo as follows:: +If none of these are suitable for you, you can run sudo as :: - sudo TERMINFO="$TERMINFO" -s -H + sudo TERMINFO="$TERMINFO" -This will start a new root shell with the correct :envvar:`TERMINFO` value from your -current environment copied over. +This will make :envvar:`TERMINFO` available +in the sudo environment. Create an alias in your shell rc files to make this +convenient:: + + alias sudo="sudo TERMINFO=\"$TERMINFO\"" If you have double width characters in your prompt, you may also need to explicitly set a UTF-8 locale, like::