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

Bash completion of tags broken since 1.7.0 #581

Closed
sanjayankur31 opened this issue Jan 8, 2024 · 9 comments
Closed

Bash completion of tags broken since 1.7.0 #581

sanjayankur31 opened this issue Jan 8, 2024 · 9 comments
Labels
bug Something isn't working

Comments

@sanjayankur31
Copy link
Contributor

We've just updated timew to 1.7.0 in Fedora. Now, my bash completion seems to be broken. For example, if I go:

timew track <TAB>

I just get all my tags:

timew track DEI\ abstract\ admin\ agenda\ ...

This isn't useful, and did not happen previously. Completion of individual tags does not work either:

timew track j<tab>

does nothing, previously, it would have completed to job and so on.

@sanjayankur31
Copy link
Contributor Author

Downgrading to 1.6.0 gets things working again.

@sanjayankur31
Copy link
Contributor Author

The diff b/w the two bash completions is quite straightforward for this bit:

@@ -42,7 +42,7 @@

 function __get_tags()
 {
-  timew tags | tail -n +4 -- | sed -e "s|[[:space:]]*-$||"
+  timew get dom.tracked.tags "${TIMEW_COMPLETION_TAGS_RANGE:-":all"}"
 }

 function __get_extensions()

The two commands don't return the same information though. The previous timew tags .. returned tags on individual lines, but the new dom system does not:

$ timew tags | tail -n +4 -- | sed -e "s|[[:space:]]*-$||"
DEI
abstract
admin
agenda
...

vs

$ timew get dom.tracked.tags "${TIMEW_COMPLETION_TAGS_RANGE:-":all"}"
DEI abstract admin ...

So the wordlist variable later where __get_tags is used is different now:

#! /bin/bash
# test.sh
function __get_tags()
{
  timew tags | tail -n +4 -- | sed -e "s|[[:space:]]*-$||"
}
declare -a wordlist
while IFS=$'\n' read -r line ; do
    wordlist+=( "${line}" )
done <<< "$( __get_tags )"

echo "** Before, wordlist was:
echo $wordlist

function __get_tags_new()
{
  timew get dom.tracked.tags "${TIMEW_COMPLETION_TAGS_RANGE:-":all"}"
}

declare -a wordlist1
while IFS=$'\n' read -r line ; do
    wordlist1+=( "${line}" )
done <<< "$( __get_tags_new )"

echo "** Now, wordlist is:
echo $wordlist1

gives:

$ ./test.sh 
** Before, wordlist was:
DEI
** Now, wordlist is:
DEI abstract admin agenda ...

@sanjayankur31 sanjayankur31 changed the title Bash completion broken since 1.7.0 Bash completion of tags broken since 1.7.0 Jan 8, 2024
@lauft
Copy link
Member

lauft commented Jan 13, 2024

@sanjayankur31 What do your tags look like? Do you have (a lot of) tags containing spaces?

@lauft lauft added the more information required More information is required to proceed label Jan 14, 2024
@sanjayankur31
Copy link
Contributor Author

sanjayankur31 commented Jan 15, 2024

@sanjayankur31 What do your tags look like? Do you have (a lot of) tags containing spaces?

No, I only have a few tags that have spaces in them. All the rest are single words (often hyphenated). Here's the output of timew get dom.tracked.tags with a few personal ones removed:

DEI abstract admin agenda appstream arbor arc atas awayday back-end bank bash bbsrc biosciences bookings bucket budget call calliope car career career-development cbt cerebellum citizenship claims clarity cloud-harness cns2022 cns2023 code coffee-break collaboration combine community commute conference conferences cortexclub coursework covid cybsafe czi dandi dataclub datalad debugging dendrify departmental deploy dinner dissemination diversity docs documentation e-i-balance eden editing editors eduroam elephant elife elifepaper email emails errand errands estates expense-claim expenses fedora feedback "festival of post docs" forum forums foss foss.fedora foss.fedora.neuro frontiers git github google-deepmind grant gsoc gym haircut harmony health hed-tools hh highfive hl23 housekeeping human "ih_project" incf issues jlems job job.ucl.cortexclub job.ucl.dataclub job.ucl.neuroml job.ucl.neuroml.agenda job.ucl.neuroml.elifepaper job.ucl.neuroml.hl23 job.ucl.neuroml.l23model join join-sig journal jupyter kavli kitchen l23 l23-hay l23model l5pc lab-tour lems lessons libneuroml libsonata lit literature lunch matlab matrix matrix-nio matteo mdf meditation meeting meetings mentoring metacell migration misc modeci modelling modelspec nest netpyne netpyne-ui neuro neurodatashare neurofedora neuroinformatics neuroml neuroml2 neuromllite news newsboat next npp nsg nwb nwb-explorer nwbexplorer ocns octave omv osb osb-status osbv1 osbv2 outreachy package packages packaging pagure paper personal phone pint-of-science planning poster presentation professional-development programming project public-engagement publication publishing pyelectro pyneuroml python react reading recycling redux research research.conferences.cns2023 research.lit.bucket research.lit.next research.reviews.dinkelbach2022 research.volunteering.softwarewg rest review reviews rpmfusion rpmlint rsS rss safety-induction sbml scripting seminar seminars service sick-leave simselect single-neuron skinnerlab slack softwarewg sprint strp structural-plasticity student students supervision survey swc talk taskforce taskreview teaching "teaching for postdocs" tech-fix timew to-skim training tutorial tvb uc ucl ucu updates upgrade upgrades vim vispy volunteering website welcome-to-fedora wellcome willow workout writing 

@sanjayankur31
Copy link
Contributor Author

Hi @lauft : please do let me know if there's anything else I can do to help debug this one. Cheers.

@lauft lauft added bug Something isn't working and removed more information required More information is required to proceed labels May 29, 2024
@lauft
Copy link
Member

lauft commented May 29, 2024

@sanjayankur31 You may give this another try with the version currently in the repository

@sanjayankur31
Copy link
Contributor Author

Thanks, will do and report back.

@sanjayankur31
Copy link
Contributor Author

Sorry for the delay, that does look like it fixes it here. Thanks very much 👍

@lauft
Copy link
Member

lauft commented Jun 20, 2024

Thanks for the feedback.

@lauft lauft closed this as completed Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants