From 7403ff9ebf373e585bd430f3d034b7be9c1056c9 Mon Sep 17 00:00:00 2001 From: marshmallow Date: Wed, 19 Nov 2025 08:28:14 +0000 Subject: [PATCH] misc changes --- doc/.vitepress/config.ts | 13 +++++++++---- doc/guides/installation.md | 26 +++++++++++++++----------- doc/guides/non-root-user.md | 3 +++ doc/guides/writing-a-hive.md | 112 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ doc/tutorial/overview.md | 4 +++- doc/guides/flakes/nixos-rebuild.md | 34 +++++++++++----------------------- doc/guides/flakes/overview.md | 10 ++++++++++ doc/snippets/getting-started/cache.nix | 13 ------------- doc/snippets/getting-started/flake-merged.nix | 14 +++++++++++--- doc/snippets/getting-started/flake.nix | 2 ++ doc/snippets/getting-started/nix.conf | 3 --- doc/tutorial/part-one/basic-hive.md | 2 +- doc/tutorial/part-one/nix-setup.md | 17 ++++------------- doc/tutorial/part-one/repo-setup.md | 17 ++++++----------- doc/tutorial/part-one/vm-setup.md | 35 ++++++++++++++++++++++++++++++----- doc/tutorial/part-two/encryption.md | 18 ++++++++++-------- wire/cli/src/cli.rs | 4 ---- wire/cli/src/main.rs | 2 +- wire/lib/src/errors.rs | 3 +++ doc/snippets/guides/installation/flake.nix | 8 +++++++- doc/snippets/guides/installation/hive.nix | 2 +- wire/lib/src/commands/common.rs | 35 ++++++++++++++++++++++++++++++----- wire/lib/src/commands/mod.rs | 5 ++++- wire/lib/src/commands/pty/mod.rs | 2 +- wire/lib/src/commands/pty/output.rs | 5 ++++- 25 file(s) changed, 278 insertion(s)(+), 111 deletion(s)(-) diff --git a/doc/.vitepress/config.ts b/doc/.vitepress/config.ts --- a/doc/.vitepress/config.ts +++ b/doc/.vitepress/config.ts @@ -85,22 +85,27 @@ ], }, { - text: "How-to Guides", + text: "How-To Guides", collapsed: false, items: [ { text: "Install wire", link: "/guides/installation" }, - { text: "Migrate to wire", link: "/guides/migrate" }, { - text: "Flakes", + text: "Write a Hive", + link: "/guides/writing-a-hive", + }, + { + text: "With Flakes", + link: "/guides/flakes/overview", items: [ - { text: "Use Flakes", link: "/guides/flakes/overview" }, { text: "Keep Using nixos-rebuild", link: "/guides/flakes/nixos-rebuild", }, ], }, + { text: "Migrate to wire", link: "/guides/migrate" }, { text: "Apply your Config", link: "/guides/apply" }, + { text: "Use a non-root user", link: "/guides/non-root-user" }, { text: "Target Nodes", link: "/guides/targeting" }, { text: "Features", diff --git a/doc/guides/installation.md b/doc/guides/installation.md --- a/doc/guides/installation.md +++ b/doc/guides/installation.md @@ -15,17 +15,13 @@ ::: +It is recommended you stick to either using a tagged version of wire, or the `stable` branch which tracks the latest stable tag. + ## Binary Cache -You should trust the substituter `https://wires.cachix.org` by -either editing `/etc/nix/nix.conf` or updating your NixOS configuration: - -::: code-group - -<<< @/snippets/getting-started/nix.conf -<<< @/snippets/getting-started/cache.nix [configuration.nix] - -::: +You must enable the [garnix binary cache](https://garnix.io/docs/caching) on all +nodes in your wire hive, otherwise they will not accept the wire key agent and +you will be compiling everything from source. ## Installation through flakes @@ -45,10 +41,18 @@ you'd like, really. ```sh -$ npins add github mrshmllow wire +$ npins add github mrshmllow wire --branch stable ``` + +Alternatively, you can use a tag instead: + +```sh +$ npins add github mrshmllow wire --at v1.0.0-alpha.0 +``` + +Then, use this pinned version of wire for both your `hive.nix` and `shell.nix`: ::: code-group <<< @/snippets/guides/installation/shell.nix{8} [shell.nix] -<<< @/snippets/guides/installation/hive.nix{8} [hive.nix] +<<< @/snippets/guides/installation/hive.nix [hive.nix] ::: diff --git a/doc/guides/non-root-user.md b/doc/guides/non-root-user.md --- a/doc/guides/non-root-user.md +++ b/doc/guides/non-root-user.md @@ -22,6 +22,9 @@ - "Non-interactive SSH Auth" here most likely meaning an SSH key, anything that does not require keyboard input in the terminal. +To put it simply, you cannot have a password on _ssh_, but you can have a +password on _sudo_. + ## Changing the user By default, the target is set to root: diff --git a/doc/guides/writing-a-hive.md b/doc/guides/writing-a-hive.md new file mode 100644 --- /dev/null +++ b/doc/guides/writing-a-hive.md @@ -0,0 +1,112 @@ +--- +comment: true +title: Write a Hive +--- + +# {{ $frontmatter.title }} + +## Anatomy of a Hive + +A "Hive" is the attribute set that you pass to `wire.makeHive`. It has the +following layout: + +```nix +# `meta` +# type: attrset +meta = { + # `meta.nixpkgs` tells wire how to get nixpkgs. + # type: "A path or an instance of nixpkgs." + nixpkgs = ; + + # `meta.specialArgs` are specialArgs to pass to each node & default + # type: attrset + specialArgs = { }; +}; + +# `defaults` is a module applied to every node +# type: NixOS Module +defaults = { ... }: { }; + +# Any other attributes are nodes. +``` + +### `` + +Other attributes are NixOs modules that describe a system. They automatically +have `defaults` and the wire NixOS module imported. + +They also have the `name` and `nodes` attributes passed to them, `name` being a string of the nodes name, and `nodes` being an attribute set of every node in the hive. + +### `meta` + +There is more detailed information about `meta` in [the +reference](/reference/meta.html). + +### `defaults` + +De-duplicate options with default node configuration. + +At the top level of a hive wire reserves the `defaults` attribute. It's applied +to every node. + +::: warning + +`defaults` must not rely on modules that a node imports, but a +node may rely on modules that default imports. + +::: + +## Example + +There is more detailed information the special options for nodes [the +reference](/reference/module.html). + +```nix:line-numbers [hive.nix] +{ + meta.nixpkgs = import some-sources-or-inputs.nixpkgs { }; + + defaults = { + # name of the node that defaults is being applied to + name, + # attribute set of all nodes + nodes, + pkgs, + ... + }: { + import = [ + ./default-module.nix + + # module that is imported for all nodes + some-flake.nixosModules.default + ]; + + # all nodes should include vim! + environment.systemPackages [ pkgs.vim ]; + }; + + node-a = { + # name of the node that defaults is being applied to + name, + # attribute set of all nodes + nodes, + pkgs, + ... + }: { + imports = [ + # import the hardware-config and all your extra stuff + ./node-a + ]; + + deployment = { + target.host = "192.0.2.1"; + tags = [ "x86" ]; + }; + }; + + # as many nodes as you'd like... + + node-g = { + # some more config + }; +} +``` diff --git a/doc/tutorial/overview.md b/doc/tutorial/overview.md --- a/doc/tutorial/overview.md +++ b/doc/tutorial/overview.md @@ -18,7 +18,9 @@ In this tutorial we will create and deploy a wire Hive. Along the way we will encounter [npins](https://github.com/andir/npins), simple NixOS -configurations, virutal machines, and deployment keys. +configurations, virtual machines, and deployment keys. + +You'll need at least 10~ GB of free disk space to complete this tutorial.
diff --git a/doc/guides/flakes/nixos-rebuild.md b/doc/guides/flakes/nixos-rebuild.md --- a/doc/guides/flakes/nixos-rebuild.md +++ b/doc/guides/flakes/nixos-rebuild.md @@ -15,7 +15,7 @@ the same name together. ::: tip -It should be noted that there are a few downsides. For example, you cannot access `config.deployment` from `nixosConfigurations`. For this reason it would be best practice to limit configuration in `colmena` to simply defining keys and deployment options. +You should include the wire module, which will provide the `deployment` options, even if nixos-rebuild can't directly use them. ::: ::: code-group @@ -24,31 +24,19 @@ Now, if we run `wire show`, you will see that wire only finds the `nixosConfigurations`-es that also match a node in the hive. +`some-other-host` is not included in the hive unless specified in `makeHive`. ``` $ wire show -Hive { - nodes: { - Name( - "node-a", - ): Node { - target: Target { - hosts: [ - "node-a", - ], - user: "root", - port: 22, - current_host: 0, - }, - build_remotely: false, - allow_local_deployment: true, - tags: {}, - keys: [], - host_platform: "x86_64-linux", - }, - }, - schema: 0, -} +Node node-a (x86_64-linux): + + > Connection: {root@node-a:22} + > Build remotely `deployment.buildOnTarget`: false + > Local apply allowed `deployment.allowLocalDeployment`: true + +Summary: 1 total node(s), totalling 0 keys (0 distinct). +Note: Listed connections are tried from Left to Right + ``` This way, you can continue using `nixos-rebuild` and wire at the same time. diff --git a/doc/guides/flakes/overview.md b/doc/guides/flakes/overview.md --- a/doc/guides/flakes/overview.md +++ b/doc/guides/flakes/overview.md @@ -27,4 +27,14 @@ $ nix flake show git+file:///some/path └───wire: unknown + +$ wire show +Node node-a (x86_64-linux): + + > Connection: {root@node-a:22} + > Build remotely `deployment.buildOnTarget`: false + > Local apply allowed `deployment.allowLocalDeployment`: true + +Summary: 1 total node(s), totalling 0 keys (0 distinct). +Note: Listed connections are tried from Left to Right ``` diff --git a/doc/snippets/getting-started/cache.nix b/doc/snippets/getting-started/cache.nix deleted file mode 100644 --- a/doc/snippets/getting-started/cache.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ - nix.settings = { - substituters = [ - "https://cache.nixos.org" - "https://cache.althaea.zone" - # ... - ]; - trusted-public-keys = [ - "cache.althaea.zone:BelRpa863X9q3Y+AOnl5SM7QFzre3qb+5I7g2s/mqHI=" - # ... - ]; - }; -} diff --git a/doc/snippets/getting-started/flake-merged.nix b/doc/snippets/getting-started/flake-merged.nix --- a/doc/snippets/getting-started/flake-merged.nix +++ b/doc/snippets/getting-started/flake-merged.nix @@ -9,14 +9,18 @@ ... } @ inputs: { wire = wire.makeHive { - # Give wire our ninixosConfigurations + # Give wire our nixosConfigurations inherit (self) nixosConfigurations; meta = { - # ... from above + nixpkgs = import nixpkgs {localSystem = "x86_64-linux";}; }; node-a.deployment = { + tags = [ + # some tags + ]; + # ... }; }; @@ -26,13 +30,17 @@ system = "x86_64-linux"; specialArgs = {inherit inputs;}; modules = [ + wire.nixosModules.default { nixpkgs.hostPlatform = "x86_64-linux"; + + # you can put deployment options here too! + deployment.target = "some-hostname"; } ]; }; - node-b = nixpkgs.lib.nixosSystem { + some-other-host = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; specialArgs = {inherit inputs;}; modules = [ diff --git a/doc/snippets/getting-started/flake.nix b/doc/snippets/getting-started/flake.nix --- a/doc/snippets/getting-started/flake.nix +++ b/doc/snippets/getting-started/flake.nix @@ -22,6 +22,8 @@ }; node-a = { + nixpkgs.hostPlatform = "x86_64-linux"; + # ... }; }; diff --git a/doc/snippets/getting-started/nix.conf b/doc/snippets/getting-started/nix.conf deleted file mode 100644 --- a/doc/snippets/getting-started/nix.conf +++ /dev/null @@ -1,3 +0,0 @@ -# /etc/nix/nix.conf -trusted-substituters = https://cache.nixos.org https://cache.althaea.zone -trusted-public-keys = ... cache.althaea.zone:BelRpa863X9q3Y+AOnl5SM7QFzre3qb+5I7g2s/mqHI= diff --git a/doc/tutorial/part-one/basic-hive.md b/doc/tutorial/part-one/basic-hive.md --- a/doc/tutorial/part-one/basic-hive.md +++ b/doc/tutorial/part-one/basic-hive.md @@ -40,7 +40,7 @@ ``` -The line `nodes: {}` means theres no "nodes" in our hive. +The line `nodes: {}` means there is no "nodes" in our hive. ## Adding The First Node diff --git a/doc/tutorial/part-one/nix-setup.md b/doc/tutorial/part-one/nix-setup.md --- a/doc/tutorial/part-one/nix-setup.md +++ b/doc/tutorial/part-one/nix-setup.md @@ -26,19 +26,10 @@ nix (Nix) 2.11.0 ``` -## Using `cache.althaea.zone` +## Binary Cache Because wire can be heavy to compile, it is distributed with a [binary -cache](https://wiki.nixos.org/wiki/Binary_Cache). It's URL is -`https://cache.althaea.zone` and it's public key is -`cache.althaea.zone:BelRpa863X9q3Y+AOnl5SM7QFzre3qb+5I7g2s/mqHI=`. +cache](https://wiki.nixos.org/wiki/Binary_Cache). -You should trust the substituter `https://wires.cachix.org` by -either editing `/etc/nix/nix.conf` or updating your NixOS configuration: - -::: code-group - -<<< @/snippets/getting-started/nix.conf -<<< @/snippets/getting-started/cache.nix [configuration.nix] - -::: +You must enable the [garnix binary cache](https://garnix.io/docs/caching) or you +will be compiling everything from source. diff --git a/doc/tutorial/part-one/repo-setup.md b/doc/tutorial/part-one/repo-setup.md --- a/doc/tutorial/part-one/repo-setup.md +++ b/doc/tutorial/part-one/repo-setup.md @@ -27,21 +27,13 @@ [nix-shell]$ git init wire-tutorial Initialized empty Git repository in /home/.../wire-tutorial/.git/ [nix-shell]$ cd wire-tutorial/ -[nix-shell]$ npins init --bare +[nix-shell]$ npins init [INFO ] Welcome to npins! [INFO ] Creating `npins` directory [INFO ] Writing default.nix [INFO ] Writing initial lock file (empty) [INFO ] Successfully written initial files to 'npins/sources.json'. -[nix-shell]$ npins add github pkpbynum nixpkgs --branch pb/disk-size-bootloader ``` - -::: details - -This tutorial is using a [PR](https://github.com/NixOS/nixpkgs/pull/449945) that -fixes virutal machine bootloader disk sizes. - -::: This has created a pinned version of `nixpkgs` for us to use in our wire hive. @@ -50,7 +42,7 @@ We can now need to tell `npins` to use `mrshmllow/wire` as a dependency. ```sh -[nix-shell]$ npins add github mrshmllow wire +[nix-shell]$ npins add github mrshmllow wire --branch stable [INFO ] Adding 'wire' … repository: https://github.com/mrshmllow/wire.git pre_releases: false @@ -102,7 +94,9 @@ pkgs.git ]; - NIX_PATH = "nixpkgs=${sources.nixpkgs.outPath}"; + shellHook = '' + export NIX_PATH="nixpkgs=${sources.nixpkgs.outPath}" + ''; } ``` @@ -113,6 +107,7 @@ ```sh [nix-shell]$ exit exit +$ cd wire-tutorial/ $ nix-shell [nix-shell]$ wire --version wire 0.5.0 diff --git a/doc/tutorial/part-one/vm-setup.md b/doc/tutorial/part-one/vm-setup.md --- a/doc/tutorial/part-one/vm-setup.md +++ b/doc/tutorial/part-one/vm-setup.md @@ -10,6 +10,9 @@ ## Creating a `vm.nix` +For this step, you'll need your ssh public key, which you can obtain from +`ssh-add -L`. + Open a text editor and edit `vm.nix`. Place in it this basic NixOS virtual machine configuration, which enables openssh and forwards it's 22 port: @@ -22,6 +25,14 @@ networking.hostName = "wire-tutorial"; + users.users.root = { + initialPassword = "root"; + openssh.authorizedKeys.keys = [ + # I made this a nix syntax error so you're forced to deal with it! + + ]; + }; + boot = { loader = { systemd-boot.enable = true; @@ -29,6 +40,8 @@ }; kernelParams = [ "console=ttyS0" ]; + + boot.growPartition = true; }; # enable openssh @@ -41,13 +54,15 @@ getty.autologinUser = "root"; }; - boot.growPartition = true; - virtualisation = { graphics = false; useBootLoader = true; + # use a 5gb disk diskSize = 5 * 1024; + + # grow the filesystem to fit the 5 gb we reserved + fileSystems."/".autoResize = true; # forward `openssh` port 22 to localhost:2222. forwardPorts = [ @@ -59,8 +74,6 @@ ]; }; - users.users.root.initialPassword = "root"; - system.stateVersion = "23.11"; } ``` @@ -70,7 +83,7 @@ ## Building & Running the virtual machine -Open a seperate Terminal tab/window/instance, ensuring you enter the development +Open a separate Terminal tab/window/instance, ensuring you enter the development shell with `nix-shell`. Then, build the virtual machine with a bootloader, taking our `vm.nix` as the nixos configuration. @@ -79,6 +92,18 @@ $ nix-shell [nix-shell]$ nix-build '' -A vmWithBootLoader -I nixos-config=./vm.nix ``` + +::: tip HELP + +If you got an error such as + +``` +error: The option `...' in `...' is already declared in `...'. +``` + +make sure you ran the above command in the `nix-shell`! + +::: Building the virtual machine can take some time, but once it completes, start it by running: diff --git a/doc/tutorial/part-two/encryption.md b/doc/tutorial/part-two/encryption.md --- a/doc/tutorial/part-two/encryption.md +++ b/doc/tutorial/part-two/encryption.md @@ -10,7 +10,7 @@ ::: tip For this tutorial we will be using [`age`](https://github.com/FiloSottile/age), -but other encryption cli tools work just as well such as GnuPG. +but other encryption CLI tools work just as well such as GnuPG. ::: ## Installing age @@ -31,7 +31,9 @@ pkgs.age # [!code ++] ]; - NIX_PATH = "nixpkgs=${sources.nixpkgs.outPath}"; + shellHook = '' + export NIX_PATH="nixpkgs=${sources.nixpkgs.outPath}" + ''; } ``` @@ -69,26 +71,26 @@ use the redirection operator to save the encrypted data to `top-secret.age`. ```sh -[nix-shell]$ echo "!! encrypted string !!" | age --encrypt --recipient $(age-keygen -y key.txt) > top-secret.age +[nix-shell]$ echo "encrypted string!" | age --encrypt --recipient $(age-keygen -y key.txt) > top-secret.age ``` ## Adding an age-encrypted key Now, lets combine our previous command-sourced key with `age`. Pass the -arguments `age --decrypt --identity key.txt ./age-secret.age` to wire: +arguments `age --decrypt --identity key.txt ./top-secret.age` to wire: ```nix:line-numbers [secrets.nix] { deployment.keys = { # ... - "age-secret" = { # [!code ++] + "top-secret" = { # [!code ++] source = [ # [!code ++] "age" # [!code ++] "--decrypt" # [!code ++] "--identity" # [!code ++] "key.txt" # [!code ++] - "${./age-secret.age}" # [!code ++] + "${./top-secret.age}" # [!code ++] ]; # [!code ++] }; # [!code ++] }; @@ -99,7 +101,7 @@ key: ```sh [Virtual Machine] -[root@wire-tutorial:~]# cat /run/keys/age-secret -!! encrypted string !! +[root@wire-tutorial:~]# cat /run/keys/top-secret +encrypted string! ``` diff --git a/wire/cli/src/cli.rs b/wire/cli/src/cli.rs --- a/wire/cli/src/cli.rs +++ b/wire/cli/src/cli.rs @@ -134,10 +134,6 @@ /// Inspect hive #[clap(visible_alias = "show")] Inspect { - /// Include liveliness - #[arg(short, long, default_value_t = false)] - online: bool, - /// Return in JSON format #[arg(short, long, default_value_t = false)] json: bool, diff --git a/wire/cli/src/main.rs b/wire/cli/src/main.rs --- a/wire/cli/src/main.rs +++ b/wire/cli/src/main.rs @@ -54,7 +54,7 @@ let mut hive = Hive::new_from_path(&location, modifiers).await?; apply::apply(&mut hive, location, apply_args, modifiers).await?; } - cli::Commands::Inspect { online: _, json } => println!("{}", { + cli::Commands::Inspect { json } => println!("{}", { let hive = Hive::new_from_path(&location, modifiers).await?; if json { serde_json::to_string(&hive).into_diagnostic()? diff --git a/wire/lib/src/errors.rs b/wire/lib/src/errors.rs --- a/wire/lib/src/errors.rs +++ b/wire/lib/src/errors.rs @@ -345,6 +345,9 @@ #[source] source: CommandError, + + #[help] + help: Option>, }, #[diagnostic( diff --git a/doc/snippets/guides/installation/flake.nix b/doc/snippets/guides/installation/flake.nix --- a/doc/snippets/guides/installation/flake.nix +++ b/doc/snippets/guides/installation/flake.nix @@ -2,6 +2,10 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; wire.url = "github:mrshmllow/wire/stable"; + + # alternatively, you can use a tag instead: + # wire.url = "github:mrshmllow/wire/v1.0.0-alpha.0"; + systems.url = "github:nix-systems/default"; }; @@ -14,7 +18,9 @@ forAllSystems = nixpkgs.lib.genAttrs (import systems); in { wire = wire.makeHive { - # ... + nixpkgs = import nixpkgs {localSystem = "x86_64-linux";}; + + # Continue to next How-To guide to fill this section }; devShells = forAllSystems ( diff --git a/doc/snippets/guides/installation/hive.nix b/doc/snippets/guides/installation/hive.nix --- a/doc/snippets/guides/installation/hive.nix +++ b/doc/snippets/guides/installation/hive.nix @@ -6,5 +6,5 @@ # give wire nixpkgs from npins meta.nixpkgs = import sources.nixpkgs {}; - # ... + # Continue to next How-To guide to fill this section } diff --git a/wire/lib/src/commands/common.rs b/wire/lib/src/commands/common.rs --- a/wire/lib/src/commands/common.rs +++ b/wire/lib/src/commands/common.rs @@ -8,7 +8,7 @@ use crate::{ EvalGoal, SubCommandModifiers, commands::{CommandArguments, Either, WireCommandChip, run_command, run_command_with_env}, - errors::HiveLibError, + errors::{CommandError, HiveLibError}, hive::{ HiveLocation, node::{Context, Push}, @@ -50,6 +50,21 @@ })?; Ok(()) +} + +fn get_common_command_help(error: &CommandError) -> Option { + if let CommandError::CommandFailed { logs, .. } = error + // marshmallow: your using this repo as a hive you idiot + && (logs.contains("attribute 'inspect' missing") + // using a flake that does not provide `wire` + || logs.contains("does not provide attribute 'packages.x86_64-linux.wire'") + // using a file called `hive.nix` that is not actually a hive + || logs.contains("attribute 'inspect' in selection path")) + { + Some("Double check this `--path` or `--flake` is a wire hive. You may be pointing to the wrong directory.".to_string()) + } else { + None + } } /// Evaluates the hive in flakeref with regards to the given goal, @@ -99,10 +114,20 @@ ) .await?; - child - .wait_till_success() - .await - .map_err(|source| HiveLibError::NixEvalError { attribute, source }) + let status = child.wait_till_success().await; + + let help = if let Err(ref error) = status { + get_common_command_help(error).map(Box::new) + } else { + None + }; + + status + .map_err(|source| HiveLibError::NixEvalError { + attribute, + source, + help, + }) .map(|x| match x { Either::Left((_, stdout)) | Either::Right((_, stdout)) => stdout, }) diff --git a/wire/lib/src/commands/mod.rs b/wire/lib/src/commands/mod.rs --- a/wire/lib/src/commands/mod.rs +++ b/wire/lib/src/commands/mod.rs @@ -109,7 +109,10 @@ envs: HashMap, ) -> Result, HiveLibError> { // use the non interactive command runner when forced - if arguments.modifiers.non_interactive { + // ... or when there is no reason for interactivity, local and unprivileged + if arguments.modifiers.non_interactive + || (arguments.target.is_none() && !arguments.is_elevated()) + { return Ok(Either::Right(non_interactive_command_with_env( arguments, envs, )?)); diff --git a/wire/lib/src/commands/pty/mod.rs b/wire/lib/src/commands/pty/mod.rs --- a/wire/lib/src/commands/pty/mod.rs +++ b/wire/lib/src/commands/pty/mod.rs @@ -121,7 +121,7 @@ } } -#[instrument(skip_all, name = "run-int", fields(elevated = %arguments.is_elevated()))] +#[instrument(skip_all, name = "run-int", fields(elevated = %arguments.is_elevated(), mode = ?arguments.output_mode))] pub(crate) async fn interactive_command_with_env>( arguments: &CommandArguments<'_, S>, envs: std::collections::HashMap, diff --git a/wire/lib/src/commands/pty/output.rs b/wire/lib/src/commands/pty/output.rs --- a/wire/lib/src/commands/pty/output.rs +++ b/wire/lib/src/commands/pty/output.rs @@ -165,7 +165,10 @@ let findings = search_string(aho_corasick, raw_mode_buffer, status_sender, began_tx); - if !matches!(findings, SearchFindings::None) { + if matches!( + findings, + SearchFindings::Started | SearchFindings::Terminate + ) { return Ok(findings); } -- tangled.sh