Replace \e with \x1B, as the former is a gcc extension

While supported by gcc and clang, \e is a gcc-specific extension and not
formally defined in the C or C++ standards.

See [0] for a list of valid escapes.

[0]: https://stackoverflow.com/a/10220539/17027
This commit is contained in:
Mahmoud Al-Qudsi
2018-06-18 00:01:32 -05:00
parent d16d463e0d
commit dcced5f1bc
13 changed files with 40 additions and 40 deletions

View File

@@ -687,7 +687,7 @@ void reader_write_title(const wcstring &cmd, bool reset_cursor_position) {
proc_push_interactive(0);
if (exec_subshell(fish_title_command, lst, false /* ignore exit status */) != -1 &&
!lst.empty()) {
fputws(L"\e]0;", stdout);
fputws(L"\x1B]0;", stdout);
for (size_t i = 0; i < lst.size(); i++) {
fputws(lst.at(i).c_str(), stdout);
}
@@ -2687,7 +2687,7 @@ const wchar_t *reader_readline(int nchars) {
break;
}
// Escape was pressed.
case L'\e': {
case L'\x1B': {
if (data->search_mode != history_search_mode_t::none) {
data->search_mode = history_search_mode_t::none;