Skip to content

Complete existing filenames when pattern starts with / on Tcsh completion #523

Closed

Description

@dilipzt

Describe the bug

Auto command completion in tcsh shell on RHEL8 and RHEL9 does not working and throwing an error which is given below. but same thing is working on BASH shell and on RHEL7 for BASH and TCSH as well

module add /_module_not_yet_loaded: Command not found.
_module_not_yet_loaded: Command not found.

To Reproduce

#Loging to any RHEL9 or RHEL8 host
#Switch to tcsh and execute
#module add /AND PRESS HERE TAB

$ tcsh
$ module add /TAB KEY for auto command completion
...

Location and content of any modulerc or modulefile involved:

$ cat path/to/modulepath/module/version

 module --version
Modules Release 5.0.1 (2021-10-16)

$ cat path/to/modulepath/module/.modulerc
$ cat path/to/modulepath/.modulerc
...

Expected behavior

when pressing two times TAB key after forward slash then it must be give expected output as below

$module add /TAB_KEY-2Times
.autorelabel boot/ home/ media/ proc/ sbin/ usr/

Error and debugging information

$ module --debug <command1> <arguments>
$ module --debug <command2> <arguments>
...

Modules version and configuration

$ module --version
$ module config --dump-state

Additional context

Activity

  1. xdelaruelle commented on Feb 14, 2024

    @xdelaruelle
    Collaborator

    Hello @dilipzt,

    More information is needed to correctly understand your issue.

    For each kind of RHEL host you access (7, 8 and 9), please run the following commands under the tcsh shell and provide the output on this ticket:

    module --version
    $MODULES_CMD tcsh autoinit
    rpm -qi environment-modules
    rpm -ql environment-modules
    ls -l /usr/share/Modules/init/
  2. dilipzt commented on Feb 14, 2024

    @dilipzt
    Author

    RHEL7_RequiredCommandOutput.txt
    RHEL8_RequiredCommandOutput.txt
    RHEL9_RequiredCommandOutput.txt

    Hi @xdelaruelle

    Please find required command output file.

    Many thanks! to working on this.

  3. xdelaruelle commented on Feb 15, 2024

    @xdelaruelle
    Collaborator

    Hi @dilipzt

    Thanks for these outputs but they are not complete. I am missing the result of the following commands:

    module --version
    $MODULES_CMD tcsh autoinit

    I would also like to see the output of the alias command to see if the completion alias are correctly defined.

    From what I understand, you would like to perform a path completion with module add command rather doing a completion against available modules.

  4. changed the title [-]Auto command completion is not working by using tcsh cell on Redhat8 and Redhat9 but same thing working for RHEL7[/-] [+]Auto command completion is not working by using tcsh Shell on Redhat8 and Redhat9 but same thing working for RHEL7[/+] on Feb 15, 2024
  5. xdelaruelle commented on Feb 15, 2024

    @xdelaruelle
    Collaborator

    I can confirm that with current Tcsh completion definition, word pattern is only completed against available modules and command options.

    I cannot explain why you observe it working on RHEL 7, unless if no completion is defined for module command.

    From what I have tested right now, it seems feasible update the completion script to complete against existing files if current word to complete matches /*, ./*, ../ or ~/ glob patterns. This change should not break completion against available modules or options if current word does not match these patterns.

  6. dilipzt commented on Feb 15, 2024

    @dilipzt
    Author

    Hey @xdelaruelle,

    Please find snapshot of required command.

    //Dilip K.
    RHEL7_Error_output
    RHEL9_Error_output

  7. changed the title [-]Auto command completion is not working by using tcsh Shell on Redhat8 and Redhat9 but same thing working for RHEL7[/-] [+]Complete existing filenames when pattern starts with `/` on Tcsh completion[/+] on Feb 15, 2024
  8. added this to the 5.4.0 milestone on Feb 15, 2024
  9. xdelaruelle commented on Feb 15, 2024

    @xdelaruelle
    Collaborator

    @dilipzt The update of tcsh_completion script I have just pushed should address your request.

  10. dilipzt commented on Feb 15, 2024

    @dilipzt
    Author

    @xdelaruelle So, Do I need to patch any particular file or go for complete installation of latest version.
    May I have the steps to address this problem - Please.

  11. xdelaruelle commented on Feb 15, 2024

    @xdelaruelle
    Collaborator

    You need to update the init/tcsh_completion file as I did in 9ae9c40.

    You should find this file in ???/modulestcl/5.0.1/init/tcsh_completion (replace ??? with the path you have obfuscated in your input).

    Please note you seem using some custom wrapper over modulecmd (as modulecmd reports Modules Wrapper for vbuild toolsetup 0.2 in the provided output).

    Once you have patched tcsh_completion file, restart a tcsh shell session. Completion should then work as expected.

    If not, please provide the output of the following commads:

    alias | grep module
    complete module
    
  12. added a commit that references this issue on Feb 16, 2024
    9ae9c40
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

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions