makew0rld / amfora Goto Github PK
View Code? Open in Web Editor NEWA fancy terminal browser for the Gemini protocol.
License: GNU General Public License v3.0
A fancy terminal browser for the Gemini protocol.
License: GNU General Public License v3.0
I'm seeing a strange behaviour - when I try to paste a URL from the clipboard into Amfora on Windows (win10 x64) it seems to truncate the URL. Similar behaviour using the right mouse click or Edit->paste menu, both of which normally paste OK in other apps.
For example here I pasted the following URL: gemini://gemini.marmaladefoo.com/blog/7-Jul-2020_GemiNaut_v0_8_6_release.gmi
the truncation happens as you paste, before you hit enter to navigate to that URL. Amfora cannot navigate as the URL is broken.
What's a good non-interfering way to achieve this? Maybe Ctrl-T with a link selected, as well as new:12
, to open link number 12 in a new tab for example.
This would improve performance with GUS usage. The cache should not be used when the URL is typed in bottom bar though.
Make two searches on GUS. On the second search, the button will be in focus, not the input field.
portal.mozz.us has this and it's useful.
In #13 I made this fix for left margins:
just shifting the content over every time it's displayed. This is less performant, but I don't know if it would make much of a difference.
It did end up making a difference, on long documents like gemini://tilde.black/users/fox/irc/log.txt
. It takes a long time to load, which is one thing, but also even once it's cached, it takes 20 seconds to view it after navigating away from it and coming back. This is because the left margin spaces are being added to the entire document again. One solution would be to have a Page.LeftMargin
integer attribute. And that's only recalculated when a reload happens, which would set it back to -1
or something.
Add some more functions to the cache
package so that it can cache redirects and load them, and have handleURL
try to use that, to prevent requesting redirects each time.
The problem is how can the user easily clear the cache? For example this would break the redirect hell test. One way would be a clear cache command, but still there could be unexpected behaviour.
It would be nice to support the commonly used keyboard shortcuts for navigating history used in common browsers (firefox, google etc) that we are all trained to use, namely:
ALT+LEFT -> go back
ALT+RIGHT -> go forward
Amfora should be able to download pages as well as any file.
downloads
option in config.toml
default set to ""
which means the config package will figure out and use the default downloads folder for each platformPage.Raw
can just be written to a file easilycert.RawSubjectPublicKeyInfo
instead of cert.Raw
.Ctrl-F should bring up a bottom bar prompt to enter a search term. On Enter a ["search"]
region will be prepended to any bit of text that matches the search, with a [""]
after it. Link selecting will have to be disabled, maybe with some global per-tab mode setting that switches between link, off, and search. Tab and Backtab can be used to navigate through all the found text fragments. Esc should switch the global per-tab mode back to off, and maybe use a regex to remove all the region open and close tags for the search.
XDG_DATA_HOME
aka ~/.local/share/
, as a TOML file
An example page with a stream URL is gemini://chat.mozz.us
, with the actual stream at gemini://chat.mozz.us/stream
.
Even for plaintext streams like the one above, this would require a major architectural change, since Page
s are designed to hold their entire content in a string. A work around could be a stream mode, which might be hard/annoying to get the user to choose though. Could be a shortcut, so they select a link and then press Ctrl-S, or maybe it could be dynamically determined once content reaches a certain length, or the connection doesn't close?
Edit: I no longer consider stream mode to be a viable solution. Large non-stream pages would also benefit from Amfora moving to a stream-based architecture.
Potentially for v1.3.0 or later.
Page
to store raw response as well as the formatted onePage
This will allow pages to dynamically change their wrap width when the terminal width changes, without reloading and causing another network request. It would double the cache size per page though.
After typing ..
on a URL like gemini://example.com/test?query
, the new URL is gemini://example.com/?query
.
It seems like the client is sending two requests on each page load, instead of one.
NOTE: If you are using SPKI as a cert ID as I recommend, then you should be re-storing the expiry date of the cert every time a request is made, BEFORE doing any checks. This is because it's possible to change a cert's expiry date but leave the SPKI section the same.
From gemini://makeworld.gq/gemlog/2020-07-03-tofu-rec.gmi
if os.Args[1] == "--version" || os.Args[1] == "-v" {
fmt.Println(version)
return
}
This could be fixed by removing Page.Displayable
, and just shifting the content over every time it's displayed. This is less performant, but I don't know if it would make much of a difference. Possibly a "Performance" issue should be opened later, and tests on very long documents done.
gemini://wp.pitr.ca/en/Gemini_(constellation)
was pasted into the bottom bar. This was the panic output:
Loading... panic: runtime error: slice bounds out of range [:17] with length 12
goroutine 82 [running]:
gitlab.com/tslocum/cview.WordWrap.func1(0xc0003b5ea8, 0xc, 0x62, 0xde3e40, 0xc)
/home/makeworld/go/pkg/mod/gitlab.com/tslocum/[email protected]/util.go:487 +0x117
gitlab.com/tslocum/cview.WordWrap.func2(0xc0000000e1, 0x0, 0x0, 0x0, 0xd1, 0x2, 0xc5, 0x1, 0xc0001e8300)
/home/makeworld/go/pkg/mod/gitlab.com/tslocum/[email protected]/util.go:535 +0x341
gitlab.com/tslocum/cview.iterateString(0xc00025a0f0, 0xe7, 0xc000169940, 0xffffffffffffffff)
/home/makeworld/go/pkg/mod/gitlab.com/tslocum/[email protected]/util.go:594 +0x187
gitlab.com/tslocum/cview.WordWrap(0xc0003b5e46, 0xea, 0x64, 0xc000238d90, 0x1, 0x1)
/home/makeworld/go/pkg/mod/gitlab.com/tslocum/[email protected]/util.go:492 +0x3a2
github.com/makeworld-the-better-one/amfora/renderer.convertRegularGemini(0xc0003b2800, 0x42a9, 0x0, 0x64, 0x0, 0x9d3f7b, 0x2, 0xc0003b2800, 0x42a9)
/home/makeworld/go/src/github.com/makeworld-the-better-one/amfora/renderer/renderer.go:133 +0xc69
github.com/makeworld-the-better-one/amfora/renderer.RenderGemini(0xc000380000, 0x4118, 0x64, 0x7e00, 0xc000380000, 0x4118, 0x0, 0x0)
/home/makeworld/go/src/github.com/makeworld-the-better-one/amfora/renderer/renderer.go:182 +0x6af
github.com/makeworld-the-better-one/amfora/renderer.MakePage(0xc00059f400, 0x2d, 0xc0000fa210, 0x64, 0x0, 0x0, 0x0)
/home/makeworld/go/src/github.com/makeworld-the-better-one/amfora/renderer/page.go:79 +0x363
github.com/makeworld-the-better-one/amfora/display.handleURL(0xc00024bc80, 0x2d, 0x0, 0x0, 0x0)
/home/makeworld/go/src/github.com/makeworld-the-better-one/amfora/display/private.go:246 +0x289
github.com/makeworld-the-better-one/amfora/display.URL.func1(0xc00024bc80, 0x2d)
/home/makeworld/go/src/github.com/makeworld-the-better-one/amfora/display/display.go:452 +0x3f
created by github.com/makeworld-the-better-one/amfora/display.URL
/home/makeworld/go/src/github.com/makeworld-the-better-one/amfora/display/display.go:451 +0xe7
This would be difficult to implement, but would be great for performance on very long documents. Might be more necessary when #9 is implemented, as streams could result in larger documents over time.
This qualifies as a "stretch goal", non-urgent and not needed for any specific release.
unincode and bullet characters do not display correctly on windows. Initially it seems it could be down to the Windows Terminal, but the same problem is seen in other terminal emulators like the suggested Cmder. Same for favicons such as makeworld.gq/favicon.txt
Cmder uses ConEmu which claims to support unicode https://conemu.github.io/en/UnicodeSupport.html
Edit: it seems some unicode points are not shown, others are. Strange. The favicon above and the bullets are not though.
Long preformatted disappears at right side, and when scrolling to the right, the text will disapear at the left. This is the correct behaviour in the code, but unexpected to the user. A better behaviour would be to have long preformatted text continue off screen, and when you scroll to the right, the text will go all the way to the left side of the screen and even off it.
One way to achieve this would be to add many spaces to the beginning of each rendered line. These spaces would have to be based on the terminal width though.
Just putting this here to remember it.
OS: OSX Mojave 10.14.6
Release: v1.2.0 amfora-darwin-amd64
panic: runtime error: index out of range [0] with length 0 [recovered]
panic: runtime error: index out of range [0] with length 0
goroutine 1 [running]:
gitlab.com/tslocum/cview.(*Application).Run.func1(0xc00011cfc0)
/home/makeworld/go/pkg/mod/gitlab.com/tslocum/[email protected]/application.go:268 +0x81
panic(0x1599b00, 0xc00056b9e0)
/usr/lib/go/src/runtime/panic.go:969 +0x166
github.com/makeworld-the-better-one/amfora/display.NewTab.func2(0xc00060000d)
/home/makeworld/go/src/github.com/makeworld-the-better-one/amfora/display/display.go:402 +0x742
gitlab.com/tslocum/cview.(*TextView).InputHandler.func1(0xc00060f7c0, 0xc00001f130)
/home/makeworld/go/pkg/mod/gitlab.com/tslocum/[email protected]/textview.go:1177 +0x1ca
gitlab.com/tslocum/cview.(*Box).WrapInputHandler.func1(0xc00060f7c0, 0xc00001f130)
/home/makeworld/go/pkg/mod/gitlab.com/tslocum/[email protected]/box.go:192 +0x5d
gitlab.com/tslocum/cview.(*Application).Run(0xc00011cfc0, 0x0, 0x0)
/home/makeworld/go/pkg/mod/gitlab.com/tslocum/[email protected]/application.go:357 +0x66d
main.main()
/home/makeworld/go/src/github.com/makeworld-the-better-one/amfora/amfora.go:42 +0x289
Sloum mentioned by email:
I missed the availability of paging down (in bombadillo the equivalent would be 'd' or 'u' to do a 3/4 page down or up)
AV-98 does this:
"A different certificate has previously been seen 999 times. That certificate is still valid for: 29 days, 14:23:08.649315"
Work is being done on the charsets
branch.
Issues
It'd be good to have an option to change colors of the browser. The default forced white-on-black colorscheme is too heavy for my eyes. I couldn't find any way to change it. Even if I turn off colors in config, it is still white-on-black.
Perhaps an option to fall back to shell colorscheme would be great. It would work perfect for everyone.
50 MiB or maybe 15 MiB. Probably should be a new config option, with a low default, maybe even 10 MiB.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.