{"record":{"id":"f64b06ca3b6e1e63","repo":"lima-vm/lima","slug":"failed-to-start-less-w","errorCode":null,"errorMessage":"failed to start less: %w","messagePattern":"failed to start less: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/limactl/shell.go","lineNumber":658,"sourceCode":"\t\t\t\t\trsyncToTempDir = true\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpagerArgs := pagerCommand()\n\t\t\tlessCmd := exec.CommandContext(ctx, pagerArgs[0], pagerArgs[1:]...)\n\n\t\t\tpipeIn, err := lessCmd.StdinPipe()\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"failed to create pipe for less: %w\", err)\n\t\t\t}\n\t\t\tif diffCmd != nil {\n\t\t\t\tdiffCmd.Stdout = pipeIn\n\t\t\t}\n\t\t\tlessCmd.Stdout = cmd.OutOrStdout()\n\t\t\tlessCmd.Stderr = cmd.OutOrStderr()\n\n\t\t\tif err := lessCmd.Start(); err != nil {\n\t\t\t\treturn fmt.Errorf(\"failed to start less: %w\", err)\n\t\t\t}\n\n\t\t\t// Write rsync dry-run output first\n\t\t\tif stats != nil {\n\t\t\t\trsyncHead := fmt.Sprintf(\"%s--- rsync dry-run statistics ---%s\", colorGray, colorNone)\n\t\t\t\tdiffHead := fmt.Sprintf(\"%s--- detailed diff --- %s\", colorGray, colorNone)\n\t\t\t\tif diffCmd == nil {\n\t\t\t\t\tdiffHead = fmt.Sprintf(\"%s--- detailed diff unavailable (`diff` not found) --- %s\", colorGray, colorNone)\n\t\t\t\t}\n\t\t\t\tcombinedOutput := fmt.Sprintf(\n\t\t\t\t\t\"%s\\n%s\\n\\n%s\\n\\n\\n%s\\n\",\n\t\t\t\t\trsyncHead,\n\t\t\t\t\tstats.String(),\n\t\t\t\t\trawOutput,\n\t\t\t\t\tdiffHead,\n\t\t\t\t)\n\n\t\t\t\tif _, err := fmt.Fprint(pipeIn, combinedOutput); err != nil {","sourceCodeStart":640,"sourceCodeEnd":676,"githubUrl":"https://github.com/lima-vm/lima/blob/dd909d0973cd84fa35f9e1693181b4585ea616c1/cmd/limactl/shell.go#L640-L676","documentation":"After wiring the diff output into the pager's stdin, limactl starts the pager process (lessCmd.Start()). If the pager binary cannot be launched — missing executable, PAGER pointing to a non-existent program, or exec permission problems — this error is returned and the pending rsync-back decision is abandoned with the guest workdir preserved.","triggerScenarios":"Selecting \"View the changed contents\" when the pager from pagerCommand() (PAGER env var or `less -R`) cannot be started: PAGER set to a missing/broken binary, PATH lacking `less`, or the pager binary lacks execute permission.","commonSituations":"Minimal containers/VMs without `less` installed; PAGER exported as something like `most` or a script that was removed; PATH modified so standard tools aren't found; Windows environments without a less equivalent.","solutions":["Fix PAGER: `export PAGER=less` or unset it to use the default `less -R`.","Install the pager (`apt install less` / `brew install less`) or verify it is on PATH: `command -v less`.","Skip preview at the prompt and choose Yes/No directly to complete the sync-back.","Recover changes manually from destRsyncDir in the guest if the session already errored out."],"exampleFix":"// before\nexport PAGER=most   # most not installed\n// after\nexport PAGER=less   # or: unset PAGER","handlingStrategy":"validation","validationCode":"p=$(echo \"${PAGER:-less}\" | awk '{print $1}'); command -v \"$p\" >/dev/null && echo \"pager '$p' found\" || echo \"pager '$p' missing: install it or unset PAGER\"","typeGuard":null,"tryCatchPattern":"// ensure a working pager before interactive limactl use\ncommand -v less >/dev/null || export PAGER=cat\nlimactl shell default","preventionTips":["Install `less` in minimal environments where you use lima.","Keep PAGER unset or pointing to an installed binary.","Verify PATH includes standard user binaries.","Skip the 'View the changed contents' option when no pager is available."],"tags":["pager","exec","less","environment"],"backgroundTag":"pager-command-not-found","analyzedSha":"dd909d0973cd84fa35f9e1693181b4585ea616c1","analyzedAt":"2026-09-01T14:24:59.842Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}