diff options
Diffstat (limited to 'src/command')
-rw-r--r-- | src/command/command.c | 12 | ||||
-rw-r--r-- | src/command/commands.c | 21 | ||||
-rw-r--r-- | src/command/commands.h | 1 |
3 files changed, 34 insertions, 0 deletions
diff --git a/src/command/command.c b/src/command/command.c index 5745e5cb..72c0c42c 100644 --- a/src/command/command.c +++ b/src/command/command.c @@ -945,6 +945,18 @@ static struct cmd_t command_defs[] = CMD_NOEXAMPLES }, + { "/charset", + cmd_charset, parse_args, 0, 0, NULL, + CMD_TAGS( + CMD_TAG_UI) + CMD_SYN( + "/beep") + CMD_DESC( + "Display information about the current character set supported by the terminal. ") + CMD_NOARGS + CMD_NOEXAMPLES + }, + { "/beep", cmd_beep, parse_args, 1, 1, &cons_beep_setting, CMD_TAGS( diff --git a/src/command/commands.c b/src/command/commands.c index 53f06b95..d3a648ac 100644 --- a/src/command/commands.c +++ b/src/command/commands.c @@ -43,6 +43,7 @@ #include <sys/types.h> #include <fcntl.h> #include <unistd.h> +#include <langinfo.h> #include "chat_session.h" #include "command/commands.h" @@ -4008,6 +4009,26 @@ cmd_privileges(ProfWin *window, const char *const command, gchar **args) } gboolean +cmd_charset(ProfWin *window, const char *const command, gchar **args) +{ + char *codeset = nl_langinfo(CODESET); + char *lang = getenv("LANG"); + + cons_show("Charset information:"); + + if (lang) { + cons_show(" LANG: %s", lang); + } + if (codeset) { + cons_show(" CODESET: %s", codeset); + } + cons_show(" MB_CUR_MAX: %d", MB_CUR_MAX); + cons_show(" MB_LEN_MAX: %d", MB_LEN_MAX); + + return TRUE; +} + +gboolean cmd_beep(ProfWin *window, const char *const command, gchar **args) { return _cmd_set_boolean_preference(args[0], command, "Sound", PREF_BEEP); diff --git a/src/command/commands.h b/src/command/commands.h index 501046d4..76794f71 100644 --- a/src/command/commands.h +++ b/src/command/commands.h @@ -151,6 +151,7 @@ gboolean cmd_inpblock(ProfWin *window, const char *const command, gchar **args); gboolean cmd_encwarn(ProfWin *window, const char *const command, gchar **args); gboolean cmd_script(ProfWin *window, const char *const command, gchar **args); gboolean cmd_export(ProfWin *window, const char *const command, gchar **args); +gboolean cmd_charset(ProfWin *window, const char *const command, gchar **args); gboolean cmd_form_field(ProfWin *window, char *tag, gchar **args); |