skyjake / lagrange Goto Github PK
View Code? Open in Web Editor NEWA Beautiful Gemini Client
Home Page: https://gmi.skyjake.fi/lagrange/
License: BSD 2-Clause "Simplified" License
A Beautiful Gemini Client
Home Page: https://gmi.skyjake.fi/lagrange/
License: BSD 2-Clause "Simplified" License
When selecting ranges of text with the mouse, it only starts selecting when the cursor is over a character and not on empty space. This should be fixed so that when starting a mouse drag on empty space, it should extend the selection to the nearest line of text before/after the cursor.
The full-width space character (aka ideographic space / U+3000) is not rendered properly, but is instead rendered as a dotted box with "ID SP" written inside it. I'm guessing this is a simple issue of which font is being picked to render it - some of the included fonts should definitely be able to display it properly.
An example can be seen at gemini://higeki.jp/fanden
The current behavior is against GUI conventions.
One can currently right-click again to dismiss a popup menu.
I was trying to write an email in a smaller window on top of Lagrange and the blinking cursor in the URL field was too distracting.
At least FireFox has a line cursor and it blinks really slow.
When using duckling-proxy
to access an HTTP site, and the site redirects you to another HTTP URL (as is very common), Lagrange doesn't follow it.
To reproduce: type http://www.unsyntax.org/
into the URL bar. This URL gets redirected to https://www.unsyntax.org
silently, as is desirable. Lagrange will present an error page.
To fix: Make sure that URLs are uniformly processed, whether they come from a request or a redirect.
This is the error I get on FreeBSD 12.1-RELEASE r354233 GENERIC amd64
> cmake --build .
Scanning dependencies of target the_Foundation
[ 1%] Building C object lib/the_Foundation/CMakeFiles/the_Foundation.dir/src/the_foundation.c.o
[ 2%] Building C object lib/the_Foundation/CMakeFiles/the_Foundation.dir/src/audience.c.o
[ 3%] Building C object lib/the_Foundation/CMakeFiles/the_Foundation.dir/src/array.c.o
[ 4%] Building C object lib/the_Foundation/CMakeFiles/the_Foundation.dir/src/block.c.o
[ 5%] Building C object lib/the_Foundation/CMakeFiles/the_Foundation.dir/src/blockhash.c.o
[ 6%] Building C object lib/the_Foundation/CMakeFiles/the_Foundation.dir/src/buffer.c.o
[ 7%] Building C object lib/the_Foundation/CMakeFiles/the_Foundation.dir/src/class.c.o
[ 8%] Building C object lib/the_Foundation/CMakeFiles/the_Foundation.dir/src/commandline.c.o
[ 9%] Building C object lib/the_Foundation/CMakeFiles/the_Foundation.dir/src/crc32.c.o
[ 10%] Building C object lib/the_Foundation/CMakeFiles/the_Foundation.dir/src/file.c.o
[ 12%] Building C object lib/the_Foundation/CMakeFiles/the_Foundation.dir/src/fileinfo.c.o
In file included from /usr/home/samuel/src/lagrange/lib/the_Foundation/src/fileinfo.c:39:
/usr/include/sys/dir.h:41:2: error: "The information in this file should be obtained from <dirent.h>" [-Werror,-W#warnings]
#warning "The information in this file should be obtained from <dirent.h>"
^
/usr/include/sys/dir.h:42:2: error: "and is provided solely (and temporarily) for backward compatibility." [-Werror,-W#warnings]
#warning "and is provided solely (and temporarily) for backward compatibility."
^
2 errors generated.
gmake[2]: *** [lib/the_Foundation/CMakeFiles/the_Foundation.dir/build.make:212: lib/the_Foundation/CMakeFiles/the_Foundation.dir/src/fileinfo.c.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:142: lib/the_Foundation/CMakeFiles/the_Foundation.dir/all] Error 2
gmake: *** [Makefile:149: all] Error 2
Hello! Love the app.
5.4.2 of the spec doesn't make it entirely clear if mailto:
should work in a link-line (the examples are all of the protocol://
variety), but as a user it seems like it should. Grepping the mailing list doesn't make it clear if the intention was to support mailto or not, but https://lists.orbitalfox.eu/archives/gemini/2020/001285.html implies that some of the people working on the spec would expect it to work.
An example line would be => mailto:[email protected] my email address
and the expected behavior on clicking it would be to hand off to the OS for whatever application is designated for email authoring.
On version 0.8.1, if I run say lagrange gopher://gopher.quux.org
or xdg-open gopher://gopher.quux.org
it doesn't open up the gopher link
I consider myself somewhat experienced in UI/UX (been interested in that stuff since ~2000).
After using Lagrange for a couple of days I still don't understand what the icons beside the links mean.
One thing I figured out is that blue color is for Gemini links and brown color is for web/other URLs.
I have no idea what's the difference between the globe / arrow / circled numbers.
Maybe a help page would help?
Maybe show hints on links or the icons?
Steps to reproduce:
Sometimes the URL field stays selected after clicking the page area.
An unreachable/nonexistent server such as gemini://ibm.com
gives no indication of failure. However, it is immediately placed in the history, so that while the viewport continues to display the previous page, the URL bar refers to the bad page.
To reproduce, open a new tab and type gemini://ibm.com
into the URL bar.
To fix, either show a dialog box or display a page saying "gemini://ibm.com is unreachable or does not exist". Nothing should go into the history unless it has been successfully retrieved.
% lagrange
[the_Foundation] version: 1.0.0 cstd:201112
[the_Foundation] locale: en_US.utf8
Lagrange: A Beautiful Gemini Client
failed to load resources: No such file or directory
% /usr/bin/lagrange
[the_Foundation] version: 1.0.0 cstd:201112
[the_Foundation] locale: en_US.utf8
Lagrange: A Beautiful Gemini Client
[window] renderer: opengl (accelerated)
[window] max texture size: 16384 x 16384
...
The most likely cause for this (that I could find) is app.c line 421, where executablePath_CommandLine
probably expects the command line program name to be a full path.
Relevant strace output:
% pwd
/home/admicos
% strace lagrange
...
stat("/home/share/lagrange/resources.binary", 0x7ffc96b175b0) = -1 ENOENT (No such file or directory)
stat("/home/share/lagrange/resources.binary", 0x7ffc96b17580) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/share/lagrange/resources.binary", O_RDONLY) = -1 ENOENT (No such file or directory)
stat("/home/admicos/resources.binary", 0x7ffc96b175b0) = -1 ENOENT (No such file or directory)
stat("/home/admicos/resources.binary", 0x7ffc96b17580) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/admicos/resources.binary", O_RDONLY) = -1 ENOENT (No such file or directory)
write(2, "failed to load resources: No suc"..., 52failed to load resources: No such file or directory
When dropping a .gmi file from Explorer on Lagrange, the path is not converted to a URL as it should. The file fails to open.
The dropped URL is: file://C:\another.gmi
The error page is:
๐ Failed to Open File
The requested file does not exist or is inaccessible. Please check the file path.
:\another.gmi
When hitting refresh on any tab or entering and address and pressing the return key, it immediately segfaults in v0.8.0+ on Linux/amd64.
Hopefully this stack trace help, as it's currently the best I know how until I learn more about gdb and core dumps. If there's something I can do to help reproduce or track this down, let me know!
When querying a dual stack server that has no route via v6 but via v4, Lagrange prints the following error message:
๐ง Network/TLS Failure
Failed to communicate with the host. Here is the error message:
>Network is unreachable
Due to peculiarities in my network, it seems that I can't get a route to gemini.circumlunar.space via v6, although it has a working AAAA record and my Computer has a somewhat working IPv6-connection. Disabling v6 altogether makes Lagrange use a working v4 connection.
IIRC the recommended behaviour for situations like these is some failover functionality, which Lagrange doesn't seem to have at this point. Would this be better suited for the_Foundation or for Lagrange? Would this even be a wanted feature?
I have "smooth" and animation effects disabled on my whole system due to it making me sick; seeing it enabled (going against my system configuration) and without a way to disable it is pretty surprising.
Would it be possible to disable it, e.g. through a configuration option?
Edit: I found the behaviour to be implemented in src/ui/documentwidget.c
, but I'm having trouble seeing how to implement it myself, so I'll put it on the side for now.
URLs are de-emphasized in most places, but shown in full in history.
This feels inconsistent.
If I have more than one tab open and I go to a page that requires input, it will end up sending me to the URL of the rightmost tab and navigating to that URL instead of the original URL that was asking for the input.
Steps to reproduce:
Expected: I expected the first tab to be populated with "gemini://gus.guru/search?helloworld"
Hi @skyjake ๐
Thank you for building a nice little window into Geminispace. As a developer, I prefer to install things on my machine using Homebrew/Cask so my immediate reaction was to create a cask for Lagrange โ https://github.com/vladimyr/homebrew-vladimyr/blob/27188d3/Casks/lagrange.rb I don't know if you are interested in maintaining your personal Homebrew tap but in case you decide so feel free to reuse my work,
cheers ๐ป
It would be pretty cool to have native markdown support.
I took a look in the source-code and from what I've been able to gather (as a C noob, basically), you're only handling gemini-formatted content (src/gmdocument.c
), and you're manually rendering it (probably for best performance, I imagine).
That means that markdown support would require a custom frontend over a markdown compiler, I guess, or "another src/gmdocument
" parsing markdown.
Considering the living hell that markdown is, I can probably imagine making a frontend over an existing markdown compiler, but I can probably guess that there are lots of thorny issues on the rendering side, e.g. tables, images, and such.
This would be no small feat, and while I originally created this issue with intent to propose help, now that I'm writing this sentence I kinda already feel overwhelmed by the required work.
My question is then: Was I correct in my assumption on how lagrange's gemini document rendering works?
If not, would you agree to take a bit of time explaining how the content handling / rendering is done?
And no matter what, would markdown support be an objective for a future major upgrade in your opinion?
gemini://rwv.io/2020-11-11.gmi
renders nothing, no header, just a blank tab in v0.7.2.
Sorry if this is fixed in v0.8.0+, it's segfaulting for me (see #32).
That makes it horribly horribly slow to scroll the page with the wheel.
Issue:
When the lagrange window is exposed, the window manager only shows the decoration, not the contents of the window.
In this video (https://video.barbed.fr/videos/watch/491a9b10-b3db-4107-aa61-5ff07272a28a), I jump between viewports 3 and 4 (Lagrange is on viewport 3). When the correct viewport is displayed, the Lagrange window does not render until I hover the mouse cursor over its location.
Expected behaviour:
I would expect the Lagrange window to always render when the viewport it resides in is displayed.
Platform:
Arch Linux x64
window manager: dwm (https://dwm.suckless.org/)
Lagrange version:
Self-compiled, 0.6 (commit: bcca576)
Trying to access gemini://drewdevault.com/cgi-bin/hn.py, I am encountering some (in my opinion) wrong handling of the relative links on that page.
A link will typically look like this:
=> web.sh?https%3A//github.blog/2020-11-16-standing-up-for-developers-youtube-dl-is-back/ YouTube-dl's repository has been restored
Clearly, this is a relative link, containing neither a scheme nor an authority section (which would begin with //)
Despite this, when clicking this link, lagrange tries to open gemini://github.blog/2020-11-16-standing-up-for-developers-youtube-dl-is-back/
. It appears to me that the //
before github.blog
is being misinterpreted as the beginning of an authority section.
I had a look at the code and gmutil.c:init_Url seems to be the culprit in this case.
if (!relativeUrlPattern_) {
relativeUrlPattern_ = new_RegExp("([a-z]+:)?([^?]*)(\\?.*)?", 0);
}
if (matchString_RegExp(relativeUrlPattern_, text, &m)) {
d->scheme = capturedRange_RegExpMatch(&m, 1);
d->path = capturedRange_RegExpMatch(&m, 2);
d->query = capturedRange_RegExpMatch(&m, 3);
}
I checked with gdb and it definitely reaches this part. This is, where I don't really grok where the new host comes from. Also, I didn't quite get why the Regex for relative links checks for a scheme, I couldn't think of a case where there is a scheme but not an authority section.
Edit: I have experimented around with the Regex from RFC 3986 Appendix B, using that in init_Url seems to solve this problem, as in the following snippet:
void init_Url(iUrl *d, const iString *text) {
static iRegExp *urlPattern_;
if (!urlPattern_) {
urlPattern_ = new_RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?", caseInsensitive_RegExpOption);
}
iRegExpMatch m;
init_RegExpMatch(&m);
if (matchString_RegExp(urlPattern_, text, &m)) {
d->scheme = capturedRange_RegExpMatch(&m, 2);
d->host = capturedRange_RegExpMatch(&m, 4);
d->port = iNullRange;
d->path = capturedRange_RegExpMatch(&m, 5);
d->query = capturedRange_RegExpMatch(&m, 6);
}
}
This doesn't split the port off, should there be any, so this is not a complete solution
Not sure how Lagrange then selects which one to use, but may lead to inconsistencies and unexpected behavior to users.
I had to manually remove "homepage" from the old bookmark, after adding it to the new bookmark.
I suggest at least adding visual aids to separate the "homepage" bookmarks from others.
History, bookmarks, identities, and open tabs are lost after a crash. Maybe it would be a good idea to flush these out to disk periodically? Lost an identity that I needed to authenticate.
Can't currently replicate the crash. Found this in the terminal, unsure if related to the crash:
140065896150784:error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac:../ssl/record/ssl3_record.c:676:
140065334228736:error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac:../ssl/record/ssl3_record.c:676:
I like to browse the SmallWeb (where I spend a lot of time) with Lagrange + duckling_proxy, but often a Gemini site links to a BigWeb site, and then I get gibberish instead of being thrown into a web browser.
So I would like to have a button and/or keystroke to easily enable/disable the proxy without having to go through the dialog box and wipe it out and then re-enter it later. That way, SmallWeb browsing remains straightforward, but when I see that a link is BigWeb, I can disable the proxy, click on the link, and re-enable the proxy when I come back to Lagrange. (There is no need to do this for the gopher proxy, for Lagrange + agena is as capable as any Gopher client.)
I realize that screen space is precious and creeping featurism is bad, but I'd really like to make Lagrange my main browser for the SmallWeb.
When using a proxy, TLS certificate verification should be done against the proxy domain instead of the one in the URL.
This maybe harder to reproduce. Possible steps:
Steps to reproduce:
Result:
Expected result:
Hello! Not sure how difficult it would be to support this, but it would be nice if pre-formatted text could be scrolled horizontally if it reaches outside of the typical page bounds.
What are your thoughts on something like this?
Lagrange is really great software. It definitely got me interested in Gemini :) Thanks!
If I open a gemini or gopher link from the command line (or say from another program that calls Lagrange), a whole new session/window of lagrange opens. It'd be great if the link could automatically open as a tab in an existing lagrange window.
Issue:
While navigating GUS (gemini://gus.guru), Lagrange frequently locks up when using the "backwards" navigation action (both by clicking the toolbar button or using the Alt+LeftArrow binding).
It seems the app locks up when the navigation brings back a page where there should be a prompt (on GUS, it would be the search box), so it would probably not just impact browsing on GUS.
There is no relevant debug trace when this issue hits.
Expected behaviour:
I could see two scenarios to choose from here:
Reproducing the issue:
Version info:
Lagrange 0.8 ( edc5194)
Arch Linux x64 (Linux karth-dev-book 5.9.3-arch1-1 #1 SMP PREEMPT Sun, 01 Nov 2020 12:58:59 +0000 x86_64 GNU/Linux
)
The title basically says what this is about. I will have a look into the code and see if I can implement it myself
Whatever you are using to convert hostnames to IP addresses looks in DNS only, and does not respect /etc/hosts
. This means that localhost
cannot be used. This is particularly bad when specifying local proxies, which have to be given as 127.0.0.1:1965
(or some other port) rather than the usual localhost:1965
.
To reproduce, run a local Gemini server and type gemini://localhost/blah/blah
into the URL bar. Alternatively, run Agena locally, set the gopher_proxy to localhost:1965
, and type gopher://gopher.floodgap.com
into the URL bar. Both tests will pass if you use 127.0.0.1
instead.
To fix, use standard Posix getaddrinfo()
instead of talking to DNS directly. If this is not feasible for some reason, load and cache /etc/hosts
and use it before going to DNS. The format is trivial, but multiple host names can appear on a single line: see man 5 hosts
for details. If this is not feasible either, special-case localhosts
directly in the code.
This interacts with #13 to give no outward sign of what is failing or why.
I'm using xmonad as WM, and whenever I arrive to the workspace in which Lagrange is running, in the space where Lagrange should be displayed there still appears whatever was being displayed on that space of the screen on the previous workspace. After moving the mouse over it, it is refreshed and Lagrange appears as it should.
Interestingly, focusing the window with the keyboard does not trigger the rendering, only hovering with the cursor.
I'm not sure how to reproduce this, and the console shows nothing suspicious. If you have any clue how to trace this issue I'm happy to help.
Happens on Lagrange 0.6.0 w/ libsdl2-2.0.12 on Gentoo amd64.
Issue:
When Lagrange is out of focus, I press a key combination that would be recognised by Lagrange, and Lagrange acts on it.
In this video (https://video.barbed.fr/videos/watch/fe80dc58-8807-4d3f-9850-74a19b1baf11), the top right terminal is focused (mouse pointer is over it). I press Ctrl+D to close the terminal, which has the side effect of triggering the Bookmark function in Lagrange, which was unfocused at the time of pressing.
Expected behaviour:
I would not expect Lagrange to trigger when a key combination is pressed when the Lagrange window is out of focus.
Platform:
Arch Linux x64
window manager: dwm (https://dwm.suckless.org/)
Lagrange version:
Self-compiled, 0.6 (commit: bcca576)
Normally on Linux you can middle click to paste previously selected text
This seems to be an issue with the foundation library but since there's no issue tracker for it I hope you won't mind me posting here.
[ 1%] Building C object lib/the_Foundation/CMakeFiles/the_Foundation.dir/src/platform/posix/datagram.c.o
/home/sircmpwn/sources/lagrange/lib/the_Foundation/src/platform/posix/datagram.c: In function 'run_DatagramThread_':
/home/sircmpwn/sources/lagrange/lib/the_Foundation/src/platform/posix/datagram.c:108:9: error: unknown type name 'fd_set'
108 | fd_set reads, errors; {
| ^~~~~~
/home/sircmpwn/sources/lagrange/lib/the_Foundation/src/platform/posix/datagram.c:109:13: error: implicit declaration of function 'FD_ZERO'; did you mean 'NZERO'? [-Werror=implicit-function-declaration]
109 | FD_ZERO(&reads);
| ^~~~~~~
| NZERO
/home/sircmpwn/sources/lagrange/lib/the_Foundation/src/platform/posix/datagram.c:111:13: error: implicit declaration of function 'FD_SET'; did you mean 'L_SET'? [-Werror=implicit-function-declaration]
111 | FD_SET(output_Pipe(&d->wakeup), &reads);
| ^~~~~~
| L_SET
/home/sircmpwn/sources/lagrange/lib/the_Foundation/src/platform/posix/datagram.c:121:25: error: implicit declaration of function 'select' [-Werror=implicit-function-declaration]
121 | int ready = select(maxfd + 1, &reads, NULL, &errors, NULL);
| ^~~~~~
/home/sircmpwn/sources/lagrange/lib/the_Foundation/src/platform/posix/datagram.c:127:13: error: implicit declaration of function 'FD_ISSET'; did you mean 'CPU_ISSET'? [-Werror=implicit-function-declaration]
127 | if (FD_ISSET(output_Pipe(&d->wakeup), &reads)) {
| ^~~~~~~~
| CPU_ISSET
Could it be possible to redefine the key used to navigate with the keyboard?
The current ALT key assigned to this functionality collides with the ubiquitous ALT+TAB combination used to cycle through windows. When I press ALT+TAB in Lagrange, it captures the ALT key, shows the numbered/lettered links and focus the URL input field. My new window is selected and when I do ALT+TAB again to return to Lagrange I always have to press ESC to unfocus the URL bar. That's really awkward.
I would like to be able to follow links with the keyboard ร la qutebrowser: I press and release the f key, the numbers/letters for the links are shown, and then I press the wanted key to follow the link.
Thanks for this wonderful gemini client.
Steps to reproduce:
Result:
Expected result:
Compilation of the_Foundation
fails on OpenBSD with the following error:
/home/wl/build/lagrange/lib/the_Foundation/src/platform/posix/address.c:66:27: error:
use of undeclared identifier 'AI_V4MAPPED_CFG'
const int hintFlags = AI_V4MAPPED_CFG | AI_ADDRCONFIG | (isEmpty_String(...
I'm compiling with OpenBSD clang version 10.0.1 on OpenBSD-current, though the issue also exists on 6.8.
I tried messing around with the ifdef
above
60 #if defined (iPlatformLinux) || defined (iPlatformMsys) || defined (iPlatformCygwin)
61 # define AI_V4MAPPED_CFG AI_V4MAPPED
62 #endif
with no real success.
Issue:
When there is a percentage symbol %
in any text input field, if the caret highlights it, the program segfaults. This can be observed in all text input fields in the UI, like address bar, input prompt (like in gemini://gus.guru/search
for example).
Note that this issue only involves the caret being directly over the percentage symbol; text selection does not pose a problem.
I could not find any other character impacted by this, however I probably haven't tested all the printable characters... I did try to go over typically reserved URL characters like ?
, &
, #
and :
but they look safe, unlike %
as explained in the present issue.
Expected behaviour:
The program would not segfault, whatever character is highlighted by the caret in a text input.
Reproducing:
Bring the caret over this character (either click with the mouse, or use arrows to move the caret over it)
Program segfaults
Can be reproduced in other text input fields, e.g. the prompt at gemini://gus.guru/search
or the proxy address fields in Settings
Version info:
Lagrange 0.8.1 (f99df67)
Lagrange: A Beautiful Gemini Client
[the_Foundation] version: 1.0.0 cstd:201112
[the_Foundation] locale: fr_FR.utf8
[window] renderer: opengl (accelerated)
Linux / x86_64 / Lagrange v0.7.1
One site is rendering incompletely in Lagrange. I tried a few refreshes, same result. No idea how to tell if this is a server issue or client issue (no logs in the terminal). It's working fine in another browser.
gemini://bleyble.com
Same site in Kristall Browser:
gemini://bleyble.com/users/quokka/
Lagrange is absolutely amazing. Thank you so much for your hard work!
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.