alinush / ck

A Python tool to manage and tag your bibliography (.bib and .pdf) files on Dropbox
13 stars 3 forks source link

Prompt disappear when writing tags #8

Open aluex opened 4 years ago

aluex commented 4 years ago

The prompt disappear when writing tags

To Reproduce Steps to reproduce the behavior:

  1. ck a https://eprint.iacr.org/2020/248.pdf
  2. write many tags to fill the current line
  3. the prompt disappears

Expected behavior The prompt should stay.

Screenshots Screenshot from 2020-09-08 14-53-22

Desktop (please complete the following information):

alinush commented 4 years ago

Hm, I don't have the problem: I tried specifying a lot of tags with autocomplete, and the prompt remained. (Assuming by "prompt" you mean the "Please enter tag(s) for 'APY20' (use Tab to autocomplete):" prompt.)

But I don't get tag suggestions on my platform because pdfgrep seems to bork with my hierarchical tags.

Qs:

  1. Can you try commenting out the pdfgrep suggestions and see if it still happens?
  2. Also, can you try reproducing this on OS X?
aluex commented 4 years ago

Hi, I've tried it.

  1. It still happens
  2. It also happens on OS X.
aluex commented 4 years ago
image
alinush commented 4 years ago

Might this have something to do with all those "\b" characters that you pass to pdfgrep? Those are "backspace" characters so they might delete output. I'm not sure how they end up being sent to the console. Perhaps something to do with how pdfgrep is called.

Can you comment out all of the pdfgrep-related stuff and try again?

alinush commented 4 years ago

For example, comment out line 614:

matches = subprocess.check_output("pdfgrep '%s' %s" % (tag_extended_regex, ck_to_pdf(ck_bib_dir, citation_key)), shell=True).decode()

If that works, then uncomment and try removing shell=True.

alinush commented 4 years ago

Alex, I changed how pdfgrep is called in https://github.com/alinush/ck/commit/3dc8b7746be26ccd0d55d4ac2ac8d6446346f7c3.

Maybe this fixes your issue? Can you check?