Unverified Commit 6f4685c8 authored by Adam C. Stephens's avatar Adam C. Stephens Committed by GitHub
Browse files

fish: 3.7.1 -> 4.0 (#367229)

parents 70ec4179 52eebd25
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -396,7 +396,7 @@ in {
  firejail = handleTest ./firejail.nix {};
  firewall = handleTest ./firewall.nix { nftables = false; };
  firewall-nftables = handleTest ./firewall.nix { nftables = true; };
  fish = handleTest ./fish.nix {};
  fish = runTest ./fish.nix;
  flannel = handleTestOn ["x86_64-linux"] ./flannel.nix {};
  flaresolverr = handleTest ./flaresolverr.nix {};
  flood = handleTest ./flood.nix {};
+19 −19
Original line number Diff line number Diff line
import ./make-test-python.nix (
  { pkgs, ... }:
{
  name = "fish";

@@ -12,17 +10,19 @@ import ./make-test-python.nix (
        coreutils
        procps # kill collides with coreutils' to test https://github.com/NixOS/nixpkgs/issues/56432
      ];
        # TODO: remove if/when #267880 is merged and this is a default
        services.logrotate.enable = false;

      # Avoid slow man cache build
      documentation.man.enable = false;
    };

    testScript = ''
  testScript =
    #python
    ''
      start_all()
      machine.wait_for_file("/etc/fish/generated_completions/coreutils.fish")
      machine.wait_for_file("/etc/fish/generated_completions/kill.fish")
      machine.succeed(
          "fish -ic 'echo $fish_complete_path' | grep -q '/share/fish/completions /etc/fish/generated_completions /root/.local/share/fish/generated_completions$'"
          "fish -ic 'echo $fish_complete_path' | grep -q '/share/fish/completions /etc/fish/generated_completions /root/.cache/fish/generated_completions$'"
      )
    '';
}
)
+17 −0
Original line number Diff line number Diff line
diff --git a/tests/checks/path.fish b/tests/checks/path.fish
index 62812571a..b0eebcd91 100644
--- a/tests/checks/path.fish
+++ b/tests/checks/path.fish
@@ -117,12 +117,6 @@ path filter --type file,dir --perm exec,write bin/fish .
 # So it passes.
 # CHECK: .
 
-mkdir -p sbin
-touch sbin/setuid-exe sbin/setgid-exe
-chmod u+s,a+x sbin/setuid-exe
-path filter --perm suid sbin/*
-# CHECK: sbin/setuid-exe
-
 # On at least FreeBSD on our CI this fails with "permission denied".
 # So we can't test it, and we fake the output instead.
 if chmod g+s,a+x sbin/setgid-exe 2>/dev/null
+58 −0
Original line number Diff line number Diff line
commit 1a219776a9a9487828a6cb3f2b9581afb308d4fb
Author: Johannes Altmanninger <aclopte@gmail.com>
Date:   Mon Mar 3 10:37:49 2025 +0100

    Add the commandline to the OSC 133 command start
    
    Given
    
            $ cat ~/.config/kitty/kitty.conf
            notify_on_cmd_finish unfocused 0.1 command notify-send "job finished with status: %s" %c
    
    kitty will send a notification whenever a long-running (>.1s) foreground
    command finishes while kitty is not focused.
    
    The %c placeholder will be replaced by the commandline.
    
    This is passed via the OSC 133 command start marker, kitty's fish shell
    integration.
    
    That integration has been disabled for fish 4.0.0 because it's no longer
    necessary since fish already prints OSC 133. But we missed the parameter for
    the command string. Fix it.  (It's debatable whether the shell or the terminal
    should provide this feature but I think we should fix this regression?)
    
    Closes #11203
    
    See https://github.com/kovidgoyal/kitty/issues/8385#issuecomment-2692659161
    
    (cherry picked from commit 4378e73fc746b539c851c22800b42fdfeb1a1964)

diff --git a/src/reader.rs b/src/reader.rs
index 46f68d8c4..5f68ac57d 100644
--- a/src/reader.rs
+++ b/src/reader.rs
@@ -88,6 +88,7 @@ use crate::libc::MB_CUR_MAX;
 use crate::nix::isatty;
 use crate::operation_context::{get_bg_context, OperationContext};
 use crate::output::parse_color;
+use crate::output::BufferedOuputter;
 use crate::output::Outputter;
 use crate::pager::{PageRendering, Pager, SelectionMotion};
 use crate::panic::AT_EXIT;
@@ -650,8 +651,13 @@ fn read_i(parser: &Parser) -> i32 {
         data.command_line.clear();
         data.update_buff_pos(EditableLineTag::Commandline, None);
         data.command_line_changed(EditableLineTag::Commandline);
-        // OSC 133 End of command
-        data.screen.write_bytes(b"\x1b]133;C\x07");
+        // OSC 133 "Command start"
+        write!(
+            BufferedOuputter::new(&mut Outputter::stdoutput().borrow_mut()),
+            "\x1b]133;C;cmdline_url={}\x07",
+            escape_string(&command, EscapeStringStyle::Url),
+        )
+        .unwrap();
         event::fire_generic(parser, L!("fish_preexec").to_owned(), vec![command.clone()]);
         let eval_res = reader_run_command(parser, &command);
         signal_clear_cancel();
Loading