atlas-engineer / nyxt

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

running next from desktop vs command line has different behavior for keyboard #628

Closed mcarifio closed 3 years ago

mcarifio commented 4 years ago

Aside: next is pretty neat. Thank you.

Description

If I run /usr/local/bin/next from the command line (bash 5), next will exit on the first keystoke. If I start the same image using a desktop shortcut (gnome3), it doesn't. At the command line a tty seems to be defined. From the desktop it isn't.

I had wanted to create a "wrapping script" to set some GTK* variables before running next. I can still do that, but I also have to create ~/.local/share/applications/next.desktop and run the script. It's a little convoluted. Once I've sanded some of the rust off my common lisp, I can probably do the right customizations in ~/.config/next/init.lisp (and steal from https://github.com/qzdl/.next.d/blob/master/init.lisp) since I really just want to increase the font size.

Reproduce

$ echo $BASH_VERSION
5.0.3(1)-release

$ /usr/local/bin/next
Next version 1.5.0
 <INFO> [11:26:32] next remote.lisp (initialize-instance :after remote-interface) -
  D-Bus addresses: (#<Unix socket address: "/run/user/1000/bus">)
 <INFO> [11:26:32] next remote.lisp (initialize-instance :after remote-interface) -
  Bus connection name: :1.9360
 <INFO> [11:26:32] next port.lisp (run-program port) -
  Current directory: /home/mcarifio/bashenv/
 <INFO> [11:26:32] next port.lisp (run-program port) -
  Platform port path: next-gtk-webkit
 <INFO> [11:26:32] next port.lisp (run-program port) -
  Platform port arguments: NIL
 <INFO> [11:26:32] next port.lisp (run-program port) -
  Platform port log file: /home/mcarifio/.local/share/next/next-gtk-webkit.log
 <WARN> [11:26:32] next remote.lisp (current-buffer) -
  No active window, picking last active buffer.
 <INFO> [11:26:32] next session.lisp (restore-sexp-session form-fun-4) -
  Restoring (https://www.google.com/ https://www.google.com/
             https://www.google.com/ https://www.patreon.com/next_browser
 <INFO> [11:26:33] next minibuffer.lisp (echo form-fun-6) -
  "Loading global history of 48 URLs."
...

# in a different window, from command line
$ ps aux|grep next
mcarifio 29512 22.1  0.2 1275172 184088 pts/4  Sl+  12:07   0:02 /usr/local/bin/next
mcarifio 29519  9.3  0.1 89973464 77640 pts/4  Sl   12:07   0:01 next-gtk-webkit

# run via gnome3 shell
$ ps aux|grep next
mcarifio 17765 22.9  0.2 1275160 183724 ?      Sl   14:37   0:02 /usr/local/bin/next
mcarifio 17777 10.1  0.1 89977008 78792 ?      Sl   14:37   0:01 next-gtk-webkit

Information

Gets a little busy below. I tried to be complete.

# OS name+version:
$ lsb_release -a
LSB Version:    core-11.0.1ubuntu1-noarch:printing-11.0.1ubuntu1-noarch:security-11.0.1ubuntu1-noarch
Distributor ID: Ubuntu
Description:    Ubuntu 19.10
Release:    19.10
Codename:   eoan

# Kernel name+version:
$ uname -a
Linux shuttle 5.3.0-22-generic #24-Ubuntu SMP Sat Nov 9 17:34:30 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

# Graphics card and driver:
$ nvidia-smi
Tue Mar 31 14:52:03 2020       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 435.21       Driver Version: 435.21       CUDA Version: 10.1     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 1070    Off  | 00000000:01:00.0  On |                  N/A |
| 11%   53C    P0    38W / 151W |   4188MiB /  8118MiB |      5%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0      3817      G   /usr/lib/xorg/Xorg                          1923MiB |
|    0      6973      G   /usr/bin/gnome-shell                         847MiB |
|    0     13104      G   /opt/zoom/zoom                                14MiB |
|    0     13491      G   ...nux-gnu/webkit2gtk-4.0/WebKitWebProcess   137MiB |
|    0     13864      G   /proc/self/exe                                85MiB |
|    0     14191      G   /usr/lib/xorg/Xorg                           105MiB |
|    0     14487      G   ...AAAAAAAAAAAAAAgAAAAAAAAA --shared-files   121MiB |
|    0     15720      G   ...s --type=gpu-process --enable-features=    82MiB |
|    0     16336      G   /snap/slack/22/usr/li                         75MiB |
|    0     16470      G   /proc/self/exe                                38MiB |
|    0     17792      G   ...nux-gnu/webkit2gtk-4.0/WebKitWebProcess    32MiB |
|    0     17824      G   ...nux-gnu/webkit2gtk-4.0/WebKitWebProcess     3MiB |
|    0     17830      G   ...nux-gnu/webkit2gtk-4.0/WebKitWebProcess     3MiB |
|    0     17868      G   ...nux-gnu/webkit2gtk-4.0/WebKitWebProcess     3MiB |
|    0     17885      G   ...nux-gnu/webkit2gtk-4.0/WebKitWebProcess     3MiB |
|    0     17916      G   ...nux-gnu/webkit2gtk-4.0/WebKitWebProcess     3MiB |
|    0     17957      G   ...nux-gnu/webkit2gtk-4.0/WebKitWebProcess     3MiB |
|    0     17991      G   ...nux-gnu/webkit2gtk-4.0/WebKitWebProcess     3MiB |
|    0     18003      G   ...nux-gnu/webkit2gtk-4.0/WebKitWebProcess     3MiB |
|    0     18031      G   ...nux-gnu/webkit2gtk-4.0/WebKitWebProcess     8MiB |
|    0     18052      G   ...nux-gnu/webkit2gtk-4.0/WebKitWebProcess     3MiB |
|    0     18075      G   ...nux-gnu/webkit2gtk-4.0/WebKitWebProcess     3MiB |
|    0     18103      G   ...nux-gnu/webkit2gtk-4.0/WebKitWebProcess     3MiB |
|    0     26541      G   ...AAAAAAAAAAAAAAgAAAAAAAAA --shared-files   620MiB |
+-----------------------------------------------------------------------------+

# Desktop environment / Window manager name+version:
$ gnome-shell --version
GNOME Shell 3.34.3

# Next version (from =M-x next-version= or =next --version=):
Next 1.5

# How you installed Next (Guix pack, package manager, build from source):
$ sudo gdebi ~mcarifio/Downloads/next_1.5_amd64.deb

# WebKitGTK+ | QtWebEngine version:
$ dpkg --list|grep -i WebKit
ii  gir1.2-javascriptcoregtk-4.0:amd64               2.28.0-0ubuntu0.19.10.2                  amd64        JavaScript engine library from WebKitGTK - GObject introspection data
ii  gir1.2-webkit2-4.0:amd64                         2.28.0-0ubuntu0.19.10.2                  amd64        Web content engine library for GTK - GObject introspection data
ii  libjavascriptcoregtk-4.0-18:amd64                2.28.0-0ubuntu0.19.10.2                  amd64        JavaScript engine library from WebKitGTK
ii  libjavascriptcoregtk-4.0-dev:amd64               2.28.0-0ubuntu0.19.10.2                  amd64        JavaScript engine library from WebKitGTK - development files
ii  libqt5webkit5:amd64                              5.212.0~alpha3-3                         amd64        Web content engine library for Qt
ii  libwebkit2gtk-4.0-37:amd64                       2.28.0-0ubuntu0.19.10.2                  amd64        Web content engine library for GTK
ii  libwebkit2gtk-4.0-dev:amd64                      2.28.0-0ubuntu0.19.10.2                  amd64        Web content engine library for GTK - development files
ii  phantomjs                                        2.1.1+dfsg-2                             amd64        minimalistic headless WebKit-based browser with JavaScript API
ii  python-pyqt5.qtwebkit                            5.12.3+dfsg-2                            amd64        Python 2 bindings for Qt5's WebKit module
ii  python3-pyqt5.qtwebkit                           5.12.3+dfsg-2                            amd64        Python 3 bindings for Qt5's WebKit module

# Output when started from a shell, see above
Ambrevar commented 4 years ago

What's the shell output when it exists on the first keystroke?

Anyway, this issue is probably gone on master. Would you like to try it?

mcarifio commented 4 years ago

Sure. It takes a bunch-o-steps to run from source, so I'll be back when I do so.

Ambrevar commented 4 years ago

Let me know if you need help. You essentially need to checkout https://github.com/joachifm/cl-webkit into ~/common-lisp, then run make.

If you have Guix, you can use build-scripts/guix.scm.

jmercouris commented 4 years ago

To clarify the above, in case it is confusing, you want to run make within the Next repository, not cl-webkit.

Ambrevar commented 4 years ago

@mcarifio Did you get the chance to try it?

jmercouris commented 4 years ago

Any update on this?

mcarifio commented 4 years ago

Not from me. The ADD kicked in. I don't know when I'll try this again.

jmercouris commented 3 years ago

If this occurs again, let's reopen.