Yvee1/hascard

hascard: setupTerm: Couldn't look up terminfo entry "st-256color"

Closed this issue · 4 comments

Hello Yvee1,

first thank you for sharing that idea on reddit.
I am looking for a good terminal based flashcard application for a while already
to learn Spanish (recently moved to Barcelona).

Thus, I would love to give it a try but unfortunately your snap does not support the st terminal?

❯ hascard
hascard: setupTerm: Couldn't look up terminfo entry "st-256color"

My idea would be to trigger your app when opening a new terminal window.
Meaning I would have to solve at least one Spanish vocab / grammar question before I can use the terminal.

Best regards,
Ivo

Yvee1 commented

Hey Ivo,
That's a great idea indeed! Regarding the issue, I actually had the same problem with the snap installation with the alacritty terminal I'm using, though it did work with other terminals. Sadly though, I do not know enough about terminfo to know how to solve that problem, I just use a package that depends on it. The good news is that with me the problem only occurred with the snap installation, so perhaps you could try another installation method and see if it works? If you have any more questions/problems feel free to ask. I will add some information about this problem in the readme.

Hey Yvee1
I finally found the time to give it another go and yes using stack everything works as expected :)

Regarding my idea I did not found the time yet to implement that.
But I let you know as soon as I have done it 🤓

Yvee1 commented

That's nice to hear :)

For you information, since hearing your idea I implemented some command line options for shuffling and reviewing only a couple cards in a deck, which may be useful for implementing your idea.

So how I would go about it is to make one big file with all your Spanish cards, say spanish.txt, and put that in some directory like ~/Documents/spanish.txt. Then you can do
for example hascard -s -a 3 ~/Documents/spanish.txt to review 3 random cards from that file. The -s shuffles the cards, and -a 3 picks the first three of them.

You will still have to figure out how to run that command when opening a new terminal window, but maybe my explanation helps you a little!

Yvee1 commented

I just looked into this issue a little and apparently it is a known issue with snap and terminfo. A workaround is to copy the terminfo file for your terminal from your system to the hascard snap directory.

Relevant links:
snapcrafters/mutt#2
https://forum.snapcraft.io/t/handling-of-alternative-terminfo-settings-kitty-term/19256
https://bugs.launchpad.net/ubuntu/+source/snapd/+bug/1834631

I'll close this issue since it's not a problem with how I setup the snap installation