Skip to content

Conversation

@keithlee96
Copy link
Contributor

@keithlee96 keithlee96 commented Sep 1, 2025

Summary

Fix the chrome-history command which always fails with "No such file or directory" and "no such table: urls" errors when called. The variables chrome_history and open are not declared inside of the function.

This function is trying to access the chrome_history and open vars that are in outer scope.

Problem

The chrome-history() function declared chrome_history and open as local variables, which
shadowed the global variables set earlier in the script. This caused the function to use empty
local variables instead of the properly initialized global ones containing the Chrome history
file path and system-appropriate open command. This caused this error:

  $ chrome-history
  cp: : No such file or directory
  Error: in prepare, no such table: urls

Solution

Remove chrome_history and open from the local variable declaration, allowing the function
to access the outer variables.

Checklist

  • All new and existing tests pass.
  • Rather than adding functions to fzf-zsh-plugin.zsh, I have created standalone scripts in bin so they can be used by non-ZSH users too.
  • Any scripts added use #!/usr/bin/env interpreter instead of potentially platform-specific direct paths (#!/bin/sh is an ok exception)
  • I have confirmed that the link(s) in my PR are valid.
  • I have read the CONTRIBUTING document.

License Acceptance

  • This repository is Apache version 2.0 licensed (some scripts may have alternate licensing inline in their code) and by making this PR, I am contributing my changes to the repository under the terms of the Apache 2 license.

These break the chrome_history command.
Fix the `chrome-history` command which was failing with "No such file or directory" and "no such table: urls" errors due to local variable shadowing. This function is trying to access the chrome_history and open vars that are in outer scope.

Signed-off-by: Keith Lee <[email protected]>
Copy link
Owner

@unixorn unixorn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, thanks!

@unixorn unixorn merged commit 7da8ed8 into unixorn:main Sep 6, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants