diff --git a/README.md b/README.md index 0daa6742..07db5c32 100644 --- a/README.md +++ b/README.md @@ -492,6 +492,8 @@ This configuration file holds general user interface settings. Default content: file_picker_command= file_picker_persist_dir=1 help_enabled=1 + help_prefix_ctrl=^ + help_prefix_meta=M- home_fetch_all=0 linefeed_on_enter=1 link_open_command= @@ -695,6 +697,22 @@ last selected file. Specifies whether to display help bar. Controlled by Ctrl-g in run-time. +### help_prefix_ctrl + +Specifies the prefix used in the help bar for control key combinations, +i.e. `^` results in `^X` being displayed for Ctrl-X. Users on macOS may +prefer the Apple modifier symbol `⌃` here. + +### help_prefix_meta + +Specifies the prefix used in the help bar for meta / alt key combinations, +i.e. `M-` results in `M-/` being displayed for Alt-/. Users on macOS may +prefer the Apple modifier symbol `⌥` here. Other alternatives include +`A-` and `Alt-`. + +Note that these prefixes are only cosmetic, the actual key bindings are +configured in `key.conf`. + ### home_fetch_all Specifies whether `home` button shall repeatedly fetch all chat history. diff --git a/lib/common/src/version.h b/lib/common/src/version.h index 7db910b3..c4f4dc9d 100644 --- a/lib/common/src/version.h +++ b/lib/common/src/version.h @@ -7,4 +7,4 @@ #pragma once -#define NCHAT_VERSION "5.18.18" +#define NCHAT_VERSION "5.18.19" diff --git a/src/nchat.1 b/src/nchat.1 index 40bd3047..ce16f910 100644 --- a/src/nchat.1 +++ b/src/nchat.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man. -.TH NCHAT "1" "August 2026" "nchat 5.18.18" "User Commands" +.TH NCHAT "1" "August 2026" "nchat 5.18.19" "User Commands" .SH NAME nchat \- ncurses chat .SH SYNOPSIS diff --git a/src/uiconfig.cpp b/src/uiconfig.cpp index 43c54956..a852e2b4 100644 --- a/src/uiconfig.cpp +++ b/src/uiconfig.cpp @@ -44,6 +44,8 @@ void UiConfig::Init() { "file_picker_command", "" }, { "file_picker_persist_dir", "1" }, { "help_enabled", "1" }, + { "help_prefix_ctrl", "^" }, + { "help_prefix_meta", "M-" }, { "home_fetch_all", "0" }, { "linefeed_on_enter", "1" }, { "link_open_command", "" }, diff --git a/src/uihelpview.cpp b/src/uihelpview.cpp index e0c57438..32e8e829 100644 --- a/src/uihelpview.cpp +++ b/src/uihelpview.cpp @@ -11,6 +11,7 @@ #include "strutil.h" #include "uicolorconfig.h" +#include "uiconfig.h" #include "uikeyconfig.h" #include "uimodel.h" @@ -270,14 +271,16 @@ std::string UiHelpView::GetKeyDisplay(const std::string& p_Func) const std::string keyName = UiKeyConfig::GetStr(p_Func); if ((keyName.size() == 9) && (keyName >= "KEY_CTRLA") && (keyName <= "KEY_CTRLZ")) { - return "^" + keyName.substr(8, 1); + static const std::string helpPrefixCtrl = UiConfig::GetStr("help_prefix_ctrl"); + return helpPrefixCtrl + keyName.substr(8, 1); } else if (std::count(keyName.begin(), keyName.end(), '\\') == 2) { const std::string keyStr = StrUtil::StrFromOct(keyName); if ((keyStr.size() == 2) && (keyStr.at(0) == '\33') && StrUtil::IsValidTextKey(keyStr.at(1))) { - return "M-" + keyStr.substr(1); + static const std::string helpPrefixMeta = UiConfig::GetStr("help_prefix_meta"); + return helpPrefixMeta + keyStr.substr(1); } } else if (keyName == "KEY_RETURN")