Immediately after following a link to an image I ran the `cat` command
and the following trace popped out:
```
Traceback (most recent call last):
File "/home/user/offpunk/offpunk.py", line 2218, in <module>
main()
File "/home/user/offpunk/offpunk.py", line 2212, in main
gc.cmdloop()
File "/nix/store/rfm2viz8cpyahnmraaayhmki7v9767gg-python3-3.12.8/lib/p
ython3.12/cmd.py", line 138, in cmdloop
stop = self.onecmd(line)
^^^^^^^^^^^^^^^^^
File "/nix/store/rfm2viz8cpyahnmraaayhmki7v9767gg-python3-3.12.8/lib/p
ython3.12/cmd.py", line 217, in onecmd
return func(arg)
^^^^^^^^^
File "/home/user/offpunk/offpunk.py", line 140, in outer
return inner(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user/offpunk/offpunk.py", line 1101, in do_cat
input=open(self.opencache.get_temp_filename(self.current_url), "rb")
,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: expected str, bytes or os.PathLike object, not NoneType
```
This was on NixOS (unstable) but using a local clone of offpunk.
```
commit 059cc366e90ae0725c692b4faca7c599458fccde
```
Thanks for the report. I can reproduce it.
I’ve a question: what were you trying to achieve?
Given that there’s the "!" bang feature, I don’t see the purpose of
"cat" and I’m considering removing the function.
Le 25 fév 21 11:07, Stephen a écrit :
>Immediately after following a link to an image I ran the `cat` command>and the following trace popped out:>>```>Traceback (most recent call last):> File "/home/user/offpunk/offpunk.py", line 2218, in <module>> main()> File "/home/user/offpunk/offpunk.py", line 2212, in main> gc.cmdloop()> File "/nix/store/rfm2viz8cpyahnmraaayhmki7v9767gg-python3-3.12.8/lib/p>ython3.12/cmd.py", line 138, in cmdloop> stop = self.onecmd(line)> ^^^^^^^^^^^^^^^^^> File "/nix/store/rfm2viz8cpyahnmraaayhmki7v9767gg-python3-3.12.8/lib/p>ython3.12/cmd.py", line 217, in onecmd> return func(arg)> ^^^^^^^^^> File "/home/user/offpunk/offpunk.py", line 140, in outer> return inner(self, *args, **kwargs)> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^> File "/home/user/offpunk/offpunk.py", line 1101, in do_cat> input=open(self.opencache.get_temp_filename(self.current_url), "rb")>,> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^>TypeError: expected str, bytes or os.PathLike object, not NoneType>```>>This was on NixOS (unstable) but using a local clone of offpunk.>>```>commit 059cc366e90ae0725c692b4faca7c599458fccde>```>>
--
Ploum - Lionel Dricot
Blog: https://www.ploum.net
Bikepunk: https://bikepunk.fr/
On Fri, Feb 21, 2025 at 04:51:09PM +0000, Ploum wrote:
> Thanks for the report. I can reproduce it.
Oh, good. I was worried it was a me thing. I seem to run into a lot of
edge cases that aren't reproducible on other systems.
> I’ve a question: what were you trying to achieve?
Since I use kitty and it can display images, I thought maybe it might
show the image again. But mostly I had just run help and saw there was
a cat command ;-)
> > Given that there’s the "!" bang feature, I don’t see the purpose of > "cat" and I’m considering removing the function.
I haven't used the ! feature. Is there a way to send a targeted link
through the bang instead of the current thing?
Le 25 fév 21 02:16, Stephen a écrit :
>> I’ve a question: what were you trying to achieve?>>Since I use kitty and it can display images, I thought maybe it might>show the image again. But mostly I had just run help and saw there was>a cat command ;-)
To view again, use "view" (or "v").
To send content to the shell, use "!" (or "shell"). But this will work
only with text content, not the picture.
You can, for example, grep through a page for STRING with "!grep STRING"
(this example is not really useful as grep is already implemented using
"find" or "/", so you can do "/STRING". But it gives you the idea.
>>>>> Given that there’s the "!" bang feature, I don’t see the purpose of>> "cat" and I’m considering removing the function.>I haven't used the ! feature. Is there a way to send a targeted link>through the bang instead of the current thing?
I don’t really understand. You would like to do "shell 2" to send the
content of link 2 to the shell, right?
Is there a reason to do that without accessing the link first? I’m
trying to understand the usecase because it would be hard to implement:
what if you have a command called "2" on which you want to run the
content?
(note that you can do "view 2" to have information on the link without
following it)
--
Ploum - Lionel Dricot
Blog: https://www.ploum.net
Bikepunk: https://bikepunk.fr/
On Fri, Feb 21, 2025 at 08:26:12PM +0000, Ploum wrote:
> Le 25 fév 21 02:16, Stephen a écrit :> >>> >> Given that there’s the "!" bang feature, I don’t see the purpose of> >> "cat" and I’m considering removing the function.> >I haven't used the ! feature. Is there a way to send a targeted link> >through the bang instead of the current thing?> > I don’t really understand. You would like to do "shell 2" to send the > content of link 2 to the shell, right?
I was thinking more of how to send just the link to the shell so that I
could, for example, open a new pane in tmux to run a second instance of
offpunky that would pull up that url.
I realize it's a bit redundant with the tour ability, but it would be
nice to be able to send arbitrary links off to arbitrary other program.
> > Is there a reason to do that without accessing the link first? I’m > trying to understand the usecase because it would be hard to implement: > what if you have a command called "2" on which you want to run the > content?
More like how you can send a link to the clipboard, but instead of the
clipboard, send it to an external command or script.
Le 25 fév 21 06:00, Stephen a écrit :
>>I realize it's a bit redundant with the tour ability, but it would be>nice to be able to send arbitrary links off to arbitrary other program.>
I had a quick try at it and it was easy: from now on, you can pipe the
"url" command.
So "url|CMD" and "url 121|CMD" should work.
It is a fairly advanced feature but it was easy to do and should not
bring new bugs.
Note that "open 121" and "view 121" already work and cover
straightforward usecases.
-- Ploum - Lionel Dricot
Blog: https://www.ploum.net
Bikepunk: https://bikepunk.fr/
On Sat, Feb 22, 2025 at 10:48:14AM +0000, Ploum wrote:
> > So "url|CMD" and "url 121|CMD" should work.>
I think it's passing the base url (or current?) instead of the numbered
url. For example:
```
ON> url
gemini://thatit.be
ON> url 1
gemini://thatit.be/2025-02-09-11-52-40.gmi
ON> url 1 | cat
gemini://thatit.be
gemini://thatit.be
```
using commit 91b056b7543db3d3aaac3fc34d74b6f01840f59c
Le 25 fév 22 07:56, Stephen a écrit :
>On Sat, Feb 22, 2025 at 10:48:14AM +0000, Ploum wrote:>>>> So "url|CMD" and "url 121|CMD" should work.>>>>I think it's passing the base url (or current?) instead of the numbered>url. For example:>>```>ON> url>gemini://thatit.be>ON> url 1>gemini://thatit.be/2025-02-09-11-52-40.gmi>ON> url 1 | cat>gemini://thatit.be>gemini://thatit.be
Ok, that was a bug caused by the space between 1 and | ( I usually don’t
put a space there). It should be solved now.
--
Ploum - Lionel Dricot
Blog: https://www.ploum.net
Bikepunk: https://bikepunk.fr/