Skip to content

[feature] Add tab to autocomplete file name #170

Closed

Description

@pdelteil

While using -pp param it would be useful to have the tab autocomplete function to load the file name.

For instance, I want to use the file brute.force.txt into the param word here:

alterx -p '{{word}}.{{suffix}}' -pp word=brute.force.txt

Activity

  1. dwisiswant0 commented on Aug 3, 2024

    @dwisiswant0
    Member

    I think that's because the shell knows when to autocomplete paths usually when they come right after a command or flag. The shell treats "word=brute.for<TAB>" as a single string, so it doesn’t recognize it as a path that needs completing because it's mixed with other text ("word=").

    For the workaround, you can set up a simple custom completion script for alterx to handle completions:

    # if you're using Bash :)
    _alterx_custom_completion() {
        local cur
    
        cur="${COMP_WORDS[COMP_CWORD]}"
        COMPREPLY=( $(compgen -f -- "$cur") )
    }
    
    complete -F _alterx_custom_completion alterx
  2. pdelteil commented on Aug 3, 2024

    @pdelteil
    Author

    Thank you.

    Works good. But doing source .bashrc gave me a different result than closing the terminal and opening it again.

  3. locked and limited conversation to collaborators on Aug 28, 2025
  4. converted this issue into a discussion #279 on Aug 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions