diff options
author | 2014-09-22 12:37:11 -0700 | |
---|---|---|
committer | 2014-09-22 12:37:11 -0700 | |
commit | 4ed4b265a55d0e6fc09f1e9324b15a0bc8a9ec81 (patch) | |
tree | d7b5604a7576303c15cb731a7c37514d0cf1f181 /builtin.cpp | |
parent | e689a3866324b275a25a1fe5511a6617743c9868 (diff) |
Show -M and -m flags in bind list
Diffstat (limited to 'builtin.cpp')
-rw-r--r-- | builtin.cpp | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/builtin.cpp b/builtin.cpp index 98ae9f63..22d1a55e 100644 --- a/builtin.cpp +++ b/builtin.cpp @@ -424,21 +424,37 @@ static void builtin_bind_list(const wchar_t *bind_mode) { continue; } - - // Append the initial 'bind' command and the name + + stdout_buffer.append(L"bind"); + + // Append the mode flags if applicable + if (mode != DEFAULT_BIND_MODE) + { + const wcstring emode = escape_string(mode, ESCAPE_ALL); + stdout_buffer.append(L" -M "); + stdout_buffer.append(emode); + } + if (sets_mode != mode) + { + const wcstring esets_mode = escape_string(sets_mode, ESCAPE_ALL); + stdout_buffer.append(L" -m "); + stdout_buffer.append(esets_mode); + } + + // Append the name wcstring tname; if (input_terminfo_get_name(seq, &tname)) { // Note that we show -k here because we have an input key name - append_format(stdout_buffer, L"bind -k %ls", tname.c_str()); + append_format(stdout_buffer, L" -k %ls", tname.c_str()); } else { // No key name, so no -k; we show the escape sequence directly - const wcstring eseq = escape_string(seq, 1); - append_format(stdout_buffer, L"bind %ls", eseq.c_str()); + const wcstring eseq = escape_string(seq, ESCAPE_ALL); + append_format(stdout_buffer, L" %ls", eseq.c_str()); } - + // Now show the list of commands for (size_t i = 0; i < ecmds.size(); i++) { |