atlas-engineer / nyxt

Nyxt - the hacker's browser.
https://nyxt-browser.com/
9.64k stars 404 forks source link

Ope new URL from the command line #3388

Open Vonfry opened 2 months ago

Vonfry commented 2 months ago

Describe the bug After creating a nyxt thread, a new url cannot be opened with the existing thread out of nyxt.

Precise recipe to reproduce the issue

  1. open a nyxt
  2. open a terminal and run nyxt <some url>

Information

ASDF version: 3.3.6 ASDF registries: (NYXT-SOURCE-REGISTRY ENVIRONMENT-SOURCE-REGISTRY USER-SOURCE-REGISTRY USER-SOURCE-REGISTRY-DIRECTORY DEFAULT-USER-SOURCE-REGISTRY SYSTEM-SOURCE-REGISTRY SYSTEM-SOURCE-REGISTRY-DIRECTORY DEFAULT-SYSTEM-SOURCE-REGISTRY) Critical dependencies: (/nix/store/yal8d9j9x34w4wzyqf7rdsc52lx50b3w-sbcl-cl-cffi-gtk-20230214-git/gtk/cl-cffi-gtk.asd /nix/store/zfl2bgv6lk3859gj5im5ndfa3hki6wr9-sbcl-cl-gobject-introspection-20230618-git/cl-gobject-introspection.asd /nix/store/37pzbd8lhfyi9zmccxyhf671z8d38yq6-sbcl-cl-webkit2-20230618-git/webkit2/cl-webkit2.asd)


**Output when started from a shell**

The new nyxt command outputs:

Nyxt version 3.11.6

[18:39:52] Source location: #P"/nix/store/0gs614434zn0jmi0r9r5clp5hja4bxab-source-patched/" [18:39:52] Nyxt already started, requesting to open URL(s): http://google.com ``` `list-messages` in old nyxt thread appends: `WARN - Warning: Error on separate thread: (UNSIGNED-BYTE 8) is not a valid :ELEMENT-TYPE for MAKE-STRING`
aadcg commented 2 months ago

@Vonfry your goal is to open a new window, not to start a new Nyxt process. From a Nyxt window, you can interactively call the command make-window. To achieve the same programmatically, please see https://discourse.atlas.engineer/t/how-to-open-a-new-browser-window-from-command-line/811.

Vonfry commented 2 months ago

André A. Gomes @.***> writes:

@Vonfry your goal is to open a new window, not to start a new Nyxt process.

Right, my goal is not to start a new Nyxt process, but is also not to open a new window.

Like firefox, chromium and qutebrowser, you can open a url in the current existing window in a new tab from cli with xdg-open easily, which is used by other applications to open a url with external application.

When there is no existing nyxt process, use ~nyxt ~ can open a nyxt process and window with that url. However, when there is an existing nyxt process, ~nyxt ~ will make the existing nyxt process throw an error "Error on separate thread: (UNSIGNED-BYTE 8) is not a valid :ELEMENT-TYPE for MAKE-STRING". I think the behaviour is not rational. At least, it should be open a new process right? Or open the url in the existing process in a new window or a new buffer in existing window?

aadcg commented 2 months ago

At least, it should be open a new process right? Or open the url in the existing process in a new window or a new buffer in existing window?

@Vonfry, that sounds reasonable to me indeed. However, in the current architecture (in which I didn't participate), Nyxt starts as a server by default. I don't consider it a sane default. In the near term, it is unlikely to change since it would require a major version bump.

In the meantime, I have found out is that the recipe I've shared above doesn't work anymore. I need to investigate.

Vonfry commented 2 months ago

In the meantime, I have found out is that the recipe I've shared above doesn't work anymore. I need to investigate.

Right, the some error "Error on separate thread: (UNSIGNED-BYTE 8) is not a valid :ELEMENT-TYPE for MAKE-STRING" for me is thrown with nyxt -r -e '(make-window "https://github.com")' and nyxt https://github.com.

Perhaps this issue is the one I want to really report.