Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion lib/common/src/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@

#pragma once

#define NCHAT_VERSION "5.18.18"
#define NCHAT_VERSION "5.18.19"
2 changes: 1 addition & 1 deletion src/nchat.1
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 2 additions & 0 deletions src/uiconfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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", "" },
Expand Down
7 changes: 5 additions & 2 deletions src/uihelpview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

#include "strutil.h"
#include "uicolorconfig.h"
#include "uiconfig.h"
#include "uikeyconfig.h"
#include "uimodel.h"

Expand Down Expand Up @@ -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")
Expand Down
Loading