unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Florian <florhizome@posteo.net>
To: Maxime Devos <maximedevos@telenet.be>, 53257@debbugs.gnu.org
Subject: [bug#53257] [PATCH] gnu: foot: expose terminfo dirs via native-search-paths
Date: Sat, 15 Jan 2022 15:19:51 +0000	[thread overview]
Message-ID: <87o84dm3fs.fsf@tp-x230-guix.mail-host-address-is-not-set> (raw)
In-Reply-To: <148b10e3686b511178ce6fc019d3c0e42868cc45.camel@telenet.be>

Hey Maxime,

the comment about native-search-paths vs search-paths was just for
better understanding.I thought they work like native inputs vs inputs,
but it seems like it's quite the opposite.

If my understanding holds, setting TERMINFO_DIRS with
native-search-paths could help all terminals that have a non-generic
terminfo (not each would). But i couldn't tell you which ones those are.
As I see major problems f.e. with QT applications, that seem related to
not setting search paths, a proposal of mine for the future would be to improve/ actually introduce good documentation to the search-patch
variables (and their relationship to profiles and propagated inputs) but
maybe simplify setting a search-path correspanding to a more distinct
group of programs. I could imagine this as something like a search-path
"type", working out like this:
(package
...
(native-search-paths
(list
(search-path-specification
(type terminal-emulator))
...)
)

at first this would just be the same as the code added to foot, but it
could be refined (people might be able to  see overlaps, and integrate
some filtering or other optimization for a specific group. Also you could maybe eventually say "install a
package but without these search-paths"). For groups like qt plugins,
it could maybe be included in the qt-wrap functionalities to look for
the paths where plugins are installed and add the corresponding search paths automatically.

Have you tried to add a search path to emacs or nano?
I kinda doubt this would do much; neither nano or emacs ship a terminfo
for kitty, or for foot. What I think could work is wrapping nano and
emacs and every terminal application that has problems to add a path
derived from generically set env vars to point to the places where
terminfo files might be installed a la
TERMINFO_DIRS=$TERMINFO_DIRS:$XDG_DATA_DIRS/
this could actually be helpful on foreign distros, but i don't know if
 apps don't already trythis by themselves.

So, to get more specific on what to do: Of your suggestions I would say
why not do 3 for foot immediately like my patch suggests, it fixes the
most immediate problems in a comprehensible and by that easily revertible way. I don't
think 2 helps much, maybe still misunderstanding things.
For 1) I don't know if I could do this, and I'm not really
motivated. It also doesn't really clash with 3. There also might be
usecases like  programs
that need info about installed terminfos without being run from the
respective terminal emulator, where having the env var in the shell
could come handy, esp for usecases like guix on a foreign distro. but
i'm not sure if these exist here.   
I also remember reading, when researching the problem with kitty sudo
emacs, possibilites for preserving chosen environment variables when switching
between different contexts, which should help.

oh, and i just set foot-direct recently, when i was investigating
this. the problems have stuck with me.

Maxime Devos <maximedevos@telenet.be> writes:

> Florian schreef op vr 14-01-2022 om 22:52 [+0000]:
>> [...]
>
> I think the basic idea here is that the following should work:
>
> $ guix shell --pure some-terminal-emulator -- some-terminal-emulator
> # e.g., kitty
> # from inside the terminal: (e.g. nano)
> $ ~/.config/guix/current/bin/guix shell some-terminal-app -- some-terminal-app
> # Variation: run under sudo
>
> This works for kitty+nano, as you note, because kitty sets TERMINFO.
> It also works for kitty+'emacs -nw'.  However, in some combinations things won't work:
>
> An example you noted is kitty+sudo+'emacs -nw'.  This doesn't work for me either.
> This seems to be caused by 'sudo' clearing too much.  As I understand it, this is
> only an illustrative counter-example, and not something that setting
> 'native-search-paths' could fix?
>
> This patch is about 'foot', so I tried running foot+nano, but that failed because
> I don't use wayland.  Anyway, there seem to be a few options here:
>
>  1. patch the source code of 'foot' to set "TERMINFO_DIRS" or "TERMINFO"
>     appropriately (I'm not sure about the exact difference) (or use wrap-program
>     in 'foot').
>
>     The benefit of this above adding search paths, is that running 'foot'
>     directly from the store could work (somewhat niche though).
>
>     It would need to be investigated whether this works for your use case of
>     setting 'foot-direct' instead of 'foot-xterm'.
>
>  2. modify 'nano', 'emacs', ... to add a "TERMINFO_DIRS" search path.
>
>     A benefit of this approach above adding it to terminal emulators,
>     is that this how search paths are supposed to be used AFAIK
>     (adding an INFOPATH, LIBRARY_PATH, CROSS_LIBRARY_PATH, CPATH, ...
>     search path to every C library that has 'info' documentation is
>     rather cumbersome, instead INFOPATH ‘belongs’ to info readers,
>     LIBRARY_PATH etc. to compilers, ...).
>
>     A downside is that setting it here can be ‘too late’.
>     E.g., in the "guix shell terminal" then "guix shell editor"
>     example, the editor and terminal application are in separate profiles
>     so guix doesn't set TERMINFO_DIRS
>
>  3. Like (2), but add it to the terminal apps instead.
>
> My order of preference: (1) > (3) > (2).
> Here, (3) would be a lot easier than (1) but almost as good,
> so maybe we could do (3) first and leave (1) for later?
>
> AFAICT It's not only 'foot' that is affected, should we do (3) for all terminal
> emulators that don't do (1) like kitty?
>
> Greetings,
> Maxime




  reply	other threads:[~2022-01-15 17:47 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-14 14:02 [bug#53257] [PATCH] gnu: foot: expose terminfo dirs via native-search-paths florhizome
2022-01-14 19:02 ` Maxime Devos
2022-01-14 22:52   ` Florian
2022-01-15 11:45     ` Maxime Devos
2022-01-15 11:48     ` Maxime Devos
2022-01-15 12:30     ` Maxime Devos
2022-01-15 15:19       ` Florian [this message]
2022-01-15 15:38         ` Maxime Devos
2022-01-15 18:46           ` Florian
2022-01-23 21:26             ` Maxime Devos
2022-01-15 15:46         ` Maxime Devos
2022-01-15 15:46         ` Maxime Devos
2022-01-15 14:24     ` Maxime Devos
2022-01-28 22:34       ` Ludovic Courtès
2022-02-08 12:46         ` Maxime Devos
2022-02-10 20:30           ` Ludovic Courtès
2022-02-10 21:45             ` Maxime Devos
2022-02-12 21:49               ` Ludovic Courtès
2022-02-27 18:34 ` [bug#53257] [PATCH] gnu: foot: Wrap the program to expose TERMINFO_DIRS Kevin Boulain
2022-02-27 18:41   ` Kevin Boulain
2022-02-27 19:22   ` Maxime Devos
2022-02-28 20:29     ` Kevin Boulain
2022-03-01 19:34     ` Kevin Boulain
2022-03-01 19:28 ` Kevin Boulain
2022-06-19  5:27   ` Tom Fitzhenry

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87o84dm3fs.fsf@tp-x230-guix.mail-host-address-is-not-set \
    --to=florhizome@posteo.net \
    --cc=53257@debbugs.gnu.org \
    --cc=maximedevos@telenet.be \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).