mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-11 11:11:13 -03:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7489ab9d5b | ||
|
|
625d9e05d8 | ||
|
|
8f11ebb9d4 | ||
|
|
27c41ba74a | ||
|
|
12cfaec0c9 | ||
|
|
e458bf5763 | ||
|
|
07543ff881 | ||
|
|
0314cb662f | ||
|
|
8c13f5894b |
@@ -1,3 +1,18 @@
|
||||
fish 3.4.1 (released March 25, 2022)
|
||||
====================================
|
||||
|
||||
This release of fish fixes the following problems identified in fish 3.4.0:
|
||||
|
||||
- An error printed after upgrading, where old instances could pick up a newer version of the ``fish_title`` function, has been fixed (:issue:`8778`)
|
||||
- fish builds correctly on NetBSD (:issue:`8788`) and OpenIndiana (:issue:`8780`).
|
||||
- ``nextd-or-forward-word``, bound to :kbd:`Alt-Right Arrow` by default, was inadvertently changed to move like ``forward-bigword``. This has been corrected (:issue:`8790`).
|
||||
- ``funcsave -q`` and ``funcsave --quiet`` now work correctly (:issue:`8830`).
|
||||
- Issues with the ``csharp`` and ``nmcli`` completions were corrected.
|
||||
|
||||
If you are upgrading from version 3.3.1 or before, please also review the release notes for 3.4.0 (included below).
|
||||
|
||||
--------------
|
||||
|
||||
fish 3.4.0 (released March 12, 2022)
|
||||
====================================
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ Synopsis
|
||||
.. synopsis::
|
||||
|
||||
funcsave FUNCTION_NAME
|
||||
funcsave [-q] [(-d | --directory) DIR] FUNCTION_NAME
|
||||
funcsave [-q | --quiet] [(-d | --directory) DIR] FUNCTION_NAME
|
||||
|
||||
|
||||
Description
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
complete -c csharp -l attach -f -r -a '(ps -A | awk \'NR > 1 { printf "%s\t%s\n", $1, $4 }\')' -d
|
||||
'Inject into other processes'
|
||||
complete -c csharp -l attach -f -r -a '(ps -A | awk \'NR > 1 { printf "%s\t%s\n", $1, $4 }\')' -d 'Inject into other processes'
|
||||
complete -c csharp -s e -f -r -d 'Specify expression to execute'
|
||||
complete -c csharp -s s -r -d 'Use file to execute'
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
set -l cname (string escape -- (nmcli -g NAME connection show --active)\t"Active connection")
|
||||
set -l nmoutput (nmcli -g NAME connection show --active 2>/dev/null)
|
||||
or exit # networkmanager isn't running, no point in completing
|
||||
set -l cname (string escape -- $nmoutput\t"Active connection")
|
||||
set -a cname (string escape -- (nmcli -g NAME connection show)\t"Connection")
|
||||
set -l ifname (string escape -- (nmcli -g DEVICE device status)\t"Interface name")
|
||||
set -l ssid (string escape -- (nmcli -g SSID device wifi list)\t"SSID")
|
||||
|
||||
@@ -4,7 +4,7 @@ function fish_title
|
||||
# If we're connected via ssh, we print the hostname.
|
||||
set -l ssh
|
||||
set -q SSH_TTY
|
||||
and set ssh "[$(prompt_hostname | string sub -l 10)]"
|
||||
and set ssh "["(prompt_hostname | string sub -l 10 | string collect)"]"
|
||||
# An override for the current command is passed as the first parameter.
|
||||
# This is used by `fg` to show the true process name, among others.
|
||||
if set -q argv[1]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
function funcsave --description "Save the current definition of all specified functions to file"
|
||||
set -l options q h/help d/directory=
|
||||
set -l options q/quiet h/help d/directory=
|
||||
argparse -n funcsave $options -- $argv
|
||||
or return
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ static void print_modifiers(outputter_t &outp, bool bold, bool underline, bool i
|
||||
bool reverse, rgb_color_t bg) {
|
||||
if (bold && enter_bold_mode) {
|
||||
// These casts are needed to work with different curses implementations.
|
||||
writembs_nofail(outp, tparm(const_cast<char *>(enter_bold_mode)));
|
||||
writembs_nofail(outp, fish_tparm(const_cast<char *>(enter_bold_mode)));
|
||||
}
|
||||
|
||||
if (underline && enter_underline_mode) {
|
||||
@@ -59,7 +59,7 @@ static void print_modifiers(outputter_t &outp, bool bold, bool underline, bool i
|
||||
writembs_nofail(outp, enter_standout_mode);
|
||||
}
|
||||
if (!bg.is_none() && bg.is_normal()) {
|
||||
writembs_nofail(outp, tparm(const_cast<char *>(exit_attribute_mode)));
|
||||
writembs_nofail(outp, fish_tparm(const_cast<char *>(exit_attribute_mode)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ static void print_colors(io_streams_t &streams, bool bold, bool underline, bool
|
||||
if (!bg.is_none()) {
|
||||
// If we have a background, stop it after the color
|
||||
// or it goes to the end of the line and looks ugly.
|
||||
writembs_nofail(outp, tparm(const_cast<char *>(exit_attribute_mode)));
|
||||
writembs_nofail(outp, fish_tparm(const_cast<char *>(exit_attribute_mode)));
|
||||
}
|
||||
outp.writech(L'\n');
|
||||
} // conveniently, 'normal' is always the last color so we don't need to reset here
|
||||
@@ -233,12 +233,12 @@ maybe_t<int> builtin_set_color(parser_t &parser, io_streams_t &streams, const wc
|
||||
print_modifiers(outp, bold, underline, italics, dim, reverse, bg);
|
||||
|
||||
if (bgcolor != nullptr && bg.is_normal()) {
|
||||
writembs_nofail(outp, tparm(const_cast<char *>(exit_attribute_mode)));
|
||||
writembs_nofail(outp, fish_tparm(const_cast<char *>(exit_attribute_mode)));
|
||||
}
|
||||
|
||||
if (!fg.is_none()) {
|
||||
if (fg.is_normal() || fg.is_reset()) {
|
||||
writembs_nofail(outp, tparm(const_cast<char *>(exit_attribute_mode)));
|
||||
writembs_nofail(outp, fish_tparm(const_cast<char *>(exit_attribute_mode)));
|
||||
} else {
|
||||
if (!outp.write_color(fg, true /* is_fg */)) {
|
||||
// We need to do *something* or the lack of any output messes up
|
||||
|
||||
@@ -44,16 +44,10 @@
|
||||
#include "fallback.h" // IWYU pragma: keep
|
||||
|
||||
#if defined(TPARM_SOLARIS_KLUDGE)
|
||||
#undef tparm
|
||||
|
||||
char *tparm_solaris_kludge(char *str, long p1, long p2, long p3, long p4, long p5, long p6, long p7,
|
||||
long p8, long p9) {
|
||||
return tparm(str, p1, p2, p3, p4, p5, p6, p7, p8, p9);
|
||||
}
|
||||
|
||||
// Re-defining just to make sure nothing breaks further down in this file.
|
||||
#define tparm tparm_solaris_kludge
|
||||
|
||||
#endif
|
||||
|
||||
int fish_mkstemp_cloexec(char *name_template) {
|
||||
|
||||
@@ -68,9 +68,11 @@ struct winsize {
|
||||
|
||||
#if defined(TPARM_SOLARIS_KLUDGE)
|
||||
/// Solaris tparm has a set fixed of parameters in its curses implementation, work around this here.
|
||||
#define tparm tparm_solaris_kludge
|
||||
#define fish_tparm tparm_solaris_kludge
|
||||
char *tparm_solaris_kludge(char *str, long p1 = 0, long p2 = 0, long p3 = 0, long p4 = 0,
|
||||
long p5 = 0, long p6 = 0, long p7 = 0, long p8 = 0, long p9 = 0);
|
||||
#else
|
||||
#define fish_tparm tparm
|
||||
#endif
|
||||
|
||||
/// These functions are missing from Solaris 10, and only accessible from
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
/// Whether term256 and term24bit are supported.
|
||||
static color_support_t color_support = 0;
|
||||
|
||||
/// Returns true if we think tparm can handle outputting a color index
|
||||
/// Returns true if we think fish_tparm can handle outputting a color index
|
||||
static bool term_supports_color_natively(unsigned int c) {
|
||||
return static_cast<unsigned>(max_colors) >= c + 1;
|
||||
}
|
||||
@@ -54,8 +54,8 @@ unsigned char index_for_color(rgb_color_t c) {
|
||||
|
||||
static bool write_color_escape(outputter_t &outp, const char *todo, unsigned char idx, bool is_fg) {
|
||||
if (term_supports_color_natively(idx)) {
|
||||
// Use tparm to emit color escape.
|
||||
writembs(outp, tparm(const_cast<char *>(todo), idx));
|
||||
// Use fish_tparm to emit color escape.
|
||||
writembs(outp, fish_tparm(const_cast<char *>(todo), idx));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ bool outputter_t::write_color(rgb_color_t color, bool is_fg) {
|
||||
return (is_fg ? write_foreground_color : write_background_color)(*this, idx);
|
||||
}
|
||||
|
||||
// 24 bit! No tparm here, just ANSI escape sequences.
|
||||
// 24 bit! No fish_tparm here, just ANSI escape sequences.
|
||||
// Foreground: ^[38;2;<r>;<g>;<b>m
|
||||
// Background: ^[48;2;<r>;<g>;<b>m
|
||||
color24_t rgb = color.to_color24();
|
||||
@@ -242,7 +242,7 @@ void outputter_t::set_color(rgb_color_t fg, rgb_color_t bg) {
|
||||
// Lastly, we set bold, underline, italics, dim, and reverse modes correctly.
|
||||
if (is_bold && !was_bold && enter_bold_mode && enter_bold_mode[0] != '\0' && !bg_set) {
|
||||
// The unconst cast is for NetBSD's benefit. DO NOT REMOVE!
|
||||
writembs_nofail(*this, tparm(const_cast<char *>(enter_bold_mode)));
|
||||
writembs_nofail(*this, fish_tparm(const_cast<char *>(enter_bold_mode)));
|
||||
was_bold = is_bold;
|
||||
}
|
||||
|
||||
@@ -304,7 +304,7 @@ int outputter_t::term_puts(const char *str, int affcnt) {
|
||||
scoped_push<outputter_t *> push(&s_tputs_receiver, this);
|
||||
s_tputs_receiver->begin_buffering();
|
||||
// On some systems, tputs takes a char*, on others a const char*.
|
||||
// Like tparm, we just cast it to unconst, that should work everywhere.
|
||||
// Like fish_tparm, we just cast it to unconst, that should work everywhere.
|
||||
int res = tputs(const_cast<char *>(str), affcnt, tputs_writer);
|
||||
s_tputs_receiver->end_buffering();
|
||||
return res;
|
||||
|
||||
@@ -134,7 +134,7 @@ static dir_remoteness_t path_remoteness(const wcstring &path) {
|
||||
// In practice the only system to use this path is NetBSD.
|
||||
struct statvfs buf {};
|
||||
if (statvfs(narrow.c_str(), &buf) < 0) return dir_remoteness_t::unknown;
|
||||
return (buf.f_flag & ST_LOCAL) ? false : true;
|
||||
return (buf.f_flag & ST_LOCAL) ? dir_remoteness_t::local : dir_remoteness_t::remote;
|
||||
#elif defined(MNT_LOCAL)
|
||||
struct statfs buf {};
|
||||
if (statfs(narrow.c_str(), &buf) < 0) return dir_remoteness_t::unknown;
|
||||
|
||||
@@ -3543,7 +3543,7 @@ void reader_data_t::handle_readline_command(readline_cmd_t c, readline_loop_stat
|
||||
}
|
||||
|
||||
auto move_style =
|
||||
(c == rl::backward_word) ? move_word_style_punctuation : move_word_style_whitespace;
|
||||
(c != rl::backward_bigword) ? move_word_style_punctuation : move_word_style_whitespace;
|
||||
move_word(active_edit_line(), MOVE_DIR_LEFT, false /* do not erase */, move_style,
|
||||
false);
|
||||
break;
|
||||
@@ -3561,7 +3561,7 @@ void reader_data_t::handle_readline_command(readline_cmd_t c, readline_loop_stat
|
||||
}
|
||||
|
||||
auto move_style =
|
||||
(c == rl::forward_word) ? move_word_style_punctuation : move_word_style_whitespace;
|
||||
(c != rl::forward_bigword) ? move_word_style_punctuation : move_word_style_whitespace;
|
||||
editable_line_t *el = active_edit_line();
|
||||
if (el->position() < el->size()) {
|
||||
move_word(el, MOVE_DIR_RIGHT, false /* do not erase */, move_style, false);
|
||||
|
||||
@@ -258,10 +258,10 @@ static bool is_visual_escape_seq(const wchar_t *code, size_t *resulting_length)
|
||||
|
||||
for (auto p : esc2) {
|
||||
if (!p) continue;
|
||||
// Test both padded and unpadded version, just to be safe. Most versions of tparm don't
|
||||
// Test both padded and unpadded version, just to be safe. Most versions of fish_tparm don't
|
||||
// actually seem to do anything these days.
|
||||
size_t esc_seq_len =
|
||||
std::max(try_sequence(tparm(const_cast<char *>(p)), code), try_sequence(p, code));
|
||||
std::max(try_sequence(fish_tparm(const_cast<char *>(p)), code), try_sequence(p, code));
|
||||
if (esc_seq_len) {
|
||||
*resulting_length = esc_seq_len;
|
||||
return true;
|
||||
@@ -632,7 +632,7 @@ void screen_t::move(int new_x, int new_y) {
|
||||
bool use_multi = multi_str != nullptr && multi_str[0] != '\0' &&
|
||||
abs(x_steps) * std::strlen(str) > std::strlen(multi_str);
|
||||
if (use_multi && cur_term) {
|
||||
char *multi_param = tparm(const_cast<char *>(multi_str), abs(x_steps));
|
||||
char *multi_param = fish_tparm(const_cast<char *>(multi_str), abs(x_steps));
|
||||
writembs(outp, multi_param);
|
||||
} else {
|
||||
for (i = 0; i < abs(x_steps); i++) {
|
||||
@@ -1288,7 +1288,7 @@ void screen_t::reset_abandoning_line(int screen_width) {
|
||||
if (screen_width > non_space_width) {
|
||||
bool justgrey = true;
|
||||
if (cur_term && enter_dim_mode) {
|
||||
std::string dim = tparm(const_cast<char *>(enter_dim_mode));
|
||||
std::string dim = fish_tparm(const_cast<char *>(enter_dim_mode));
|
||||
if (!dim.empty()) {
|
||||
// Use dim if they have it, so the color will be based on their actual normal
|
||||
// color and the background of the termianl.
|
||||
@@ -1300,24 +1300,24 @@ void screen_t::reset_abandoning_line(int screen_width) {
|
||||
if (max_colors >= 238) {
|
||||
// draw the string in a particular grey
|
||||
abandon_line_string.append(
|
||||
str2wcstring(tparm(const_cast<char *>(set_a_foreground), 237)));
|
||||
str2wcstring(fish_tparm(const_cast<char *>(set_a_foreground), 237)));
|
||||
} else if (max_colors >= 9) {
|
||||
// bright black (the ninth color, looks grey)
|
||||
abandon_line_string.append(
|
||||
str2wcstring(tparm(const_cast<char *>(set_a_foreground), 8)));
|
||||
str2wcstring(fish_tparm(const_cast<char *>(set_a_foreground), 8)));
|
||||
} else if (max_colors >= 2 && enter_bold_mode) {
|
||||
// we might still get that color by setting black and going bold for bright
|
||||
abandon_line_string.append(
|
||||
str2wcstring(tparm(const_cast<char *>(enter_bold_mode))));
|
||||
str2wcstring(fish_tparm(const_cast<char *>(enter_bold_mode))));
|
||||
abandon_line_string.append(
|
||||
str2wcstring(tparm(const_cast<char *>(set_a_foreground), 0)));
|
||||
str2wcstring(fish_tparm(const_cast<char *>(set_a_foreground), 0)));
|
||||
}
|
||||
}
|
||||
|
||||
abandon_line_string.append(get_omitted_newline_str());
|
||||
|
||||
if (cur_term && exit_attribute_mode) {
|
||||
abandon_line_string.append(str2wcstring(tparm(
|
||||
abandon_line_string.append(str2wcstring(fish_tparm(
|
||||
const_cast<char *>(exit_attribute_mode)))); // normal text ANSI escape sequence
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user