Call for testing - cheat

Hi snapcrafters,

I snapped up a cheat sheet for the terminal which can be tested. Cheat is a terminal based cheat sheet manager.

Here is the link: Cheat - snapcraft - this is forked from the snapcrafters fork-and-rename-me repo.

I struggeled a lot to integrate OS native editors vim, nano to be used out of my snap - now instead I managed to package nano with cheat and configured cheat to use this.
With VIM i was not so lucky - so help here is much appreciated. Do I understand it correctly, that I have to ship all editors in the snap if I do not want to avoid the classic confinement?

Another point:
Unfortunately I already created a repo in Launchpad and build + released the cheat snap there. I’ll try to change the repo to the proper one as soon as this process is through.
I published this snap for armhf which is not working atm. and I don’t get it unpublished - it would be much apprechiated if someone could help me out on how I can do this.

As this is my first try to build a snap and I did never build an application before I am glad for all comments on how to imporve this.

Greetings
Michael

1 Like

Why does this snap require an integrated text editor?

Otherwise (without including an editor) I got the message

Could not launch vim

In the cheat command one can access given cheat sheets, but also edit and enhance them (via a shell editor). When I tried to launch an editor the snap (as confined) did not provide access to my native editor.

So for example if I would like to add a custom find command it would look like this:
multipass@snapcrafter:~/snap/temp/cheat$ cheat -e find
You must set a CHEAT_EDITOR, VISUAL, or EDITOR environment variable in order to create/edit a cheatsheet.
multipass@snapcrafter:~/snap/temp/cheat$ export EDITOR=vim
multipass@snapcrafter:~/snap/temp/cheat$ cheat -e find
Could not launch vim
multipass@snapcrafter:~/snap/temp/cheat$ which vim
/usr/bin/vim

If you know how to prevent this I am glad to remove this dependency, but I do not know how right now.

1 Like

Try setting EDITOR to xdg-open, snapd will call the external application to open the file

1 Like

Thanks :grinning:, but same issue there.

    multipass@snapcrafter:~/snap/temp/cheat$ which xdg-open
    /usr/bin/xdg-open
    multipass@snapcrafter:~/snap/temp/cheat$ cheat -e vim
    Could not launch xdg-open

Maybe I am not clear enough about my problem: cheat does not need an EDITOR to display a cheat sheet this is done via printing the content of a cheatsheet file to stdout on the shell.

When I just want to see which find commands are there I run a cheat find then the content of my find cheatsheet is printed to stdout as expected.

If I want to extend a cheat sheet let’s say for the find command I would run cheat -e find which then should launch my editor of choice (for me it would be vim or nano) with the cheat sheet file for the find command loaded.

I just followed some interesting threads from your profile and saw this: a passthrough feature - is this a road worth looking into? And another one is this withelist - https://github.com/snapcore/snapd/blob/master/interfaces/apparmor/template.go#L106 - does this mean all utilities listed there are usable from within my snap?