Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sets up tab completion for tcsh on conda activate #3244

Merged
merged 2 commits into from
Apr 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions isis/scripts/isis3VarInit.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ def mkdir( p ):
setenv ISISROOT {}
setenv ISIS3DATA {}
setenv ISIS3TESTDATA {}

source $CONDA_PREFIX/scripts/tabCompletion.csh
""".format(os.environ['CONDA_PREFIX'], args.data_dir, args.test_dir)
a.write(script)
print( 'Wrote '+activate_vars_csh )
Expand Down
25 changes: 25 additions & 0 deletions isis/scripts/tabCompletion.csh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/csh


# Setup tab completion
if ( -f $ISISROOT/bin/isiscomplete ) then
set newBinaries = `/bin/ls $ISISROOT/bin/xml | grep -v qt.conf | sed s%\.xml%%`
set i = 0
set loop = 0
set chunk = ""
foreach app ($newBinaries)
@ i = $i + 1
@ loop = $loop + 1
set chunk = "$chunk $app"
if ( "$i" == 100 || "$loop" == $#newBinaries) then
eval `$ISISROOT/bin/isiscomplete $chunk`
set i = 1
set chunk = ""
endif
end
unset i
unset loop
unset chunk
unset app
unset newBinaries
endif