From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id +F2JB6wI42FgbwAAgWs5BA (envelope-from ) for ; Sat, 15 Jan 2022 18:47:24 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id eClGBKwI42GonAAAauVa8A (envelope-from ) for ; Sat, 15 Jan 2022 18:47:24 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id B89B739DB4 for ; Sat, 15 Jan 2022 18:47:23 +0100 (CET) Received: from localhost ([::1]:55622 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n8n98-0006ZI-J1 for larch@yhetil.org; Sat, 15 Jan 2022 12:47:22 -0500 Received: from eggs.gnu.org ([209.51.188.92]:46536) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n8n8Z-0006Xb-40 for guix-patches@gnu.org; Sat, 15 Jan 2022 12:46:47 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:48766) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n8n7r-0005gg-79 for guix-patches@gnu.org; Sat, 15 Jan 2022 12:46:12 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n8n7r-0001Oz-6A for guix-patches@gnu.org; Sat, 15 Jan 2022 12:46:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53257] [PATCH] gnu: foot: expose terminfo dirs via native-search-paths Resent-From: Florian Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 15 Jan 2022 17:46:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53257 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxime Devos , 53257@debbugs.gnu.org Received: via spool by 53257-submit@debbugs.gnu.org id=B53257.16422687393925 (code B ref 53257); Sat, 15 Jan 2022 17:46:03 +0000 Received: (at 53257) by debbugs.gnu.org; 15 Jan 2022 17:45:39 +0000 Received: from localhost ([127.0.0.1]:41663 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n8n7S-00010a-Ay for submit@debbugs.gnu.org; Sat, 15 Jan 2022 12:45:39 -0500 Received: from mout01.posteo.de ([185.67.36.65]:34013) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n8ksc-0004q7-72 for 53257@debbugs.gnu.org; Sat, 15 Jan 2022 10:22:13 -0500 Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id 093B4240026 for <53257@debbugs.gnu.org>; Sat, 15 Jan 2022 16:22:03 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1642260124; bh=uy3k0bchADvIsES9BWouTdyqQc+9Zjump+vBkvq3SQ8=; h=From:To:Subject:Date:From; b=gnnwIVOZi/oY9S/327FxfB+tWr106CaoJezv4Zgh+Of9cmeFdutZOi0jtnNig0d3U e8RWWJh3d5nqLZV6Ge8lPLtEE6SWP24TLeyLPwTRgoijYcgomRLaxrA2xBIMYhdkPd PI/SzkF/AE86MgatFgV3i9Lh1q681s7P7AIORdbrAF45dEtwLDKDi5Keo2iEL1MNWW vMJdi+AEceVFBgkStq5agVvkM9iakYsVxBJ8QscSF4k8c0w+Wxqd8Buan98mxwFF6o qB27T1h5k5XO5T/b/6ZOn1Mni4ySwddz5JXFl1h3WmSXpYGqodWWJ8ExEJb9fq1nr0 xOA7Zh3k6z2ew== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4JbhjQ4gxsz9rxb; Sat, 15 Jan 2022 16:22:02 +0100 (CET) From: Florian In-Reply-To: <148b10e3686b511178ce6fc019d3c0e42868cc45.camel@telenet.be> References: <811cc55626870dbf37af3418e8effe191948541a.1642168254.git.florhizome@posteo.net> <070637a9bb8fc9a51bd39b0a2666ede537bdc949.camel@telenet.be> <87sftqlykz.fsf@tp-x230-guix.mail-host-address-is-not-set> <148b10e3686b511178ce6fc019d3c0e42868cc45.camel@telenet.be> Date: Sat, 15 Jan 2022 15:19:51 +0000 Message-ID: <87o84dm3fs.fsf@tp-x230-guix.mail-host-address-is-not-set> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Mailman-Approved-At: Sat, 15 Jan 2022 12:45:36 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1642268843; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=d5N/O6G7bA0V2NoCghb5XpkqO4Ntoq0G+9LN4Ufb9Ew=; b=etd3giRs8mQ3IyXtNTbw10e/6MU4assnKfgMw7Rx24R59KI/jiykjf20O/FDnQmxN5emg4 sLSGPk78fSoakTMIhj4I8J76uuAPEprDfYqn1aKO5K6f0KfdY2pM+p8p3aaLWraBBpjo9s 3u4aHj/+Fw6KcI34VhJUdy+KCnKTz2X3vLrUCHTTJrrJT/nIJ1XeVLinNwIX2vqA5BkNLf i1sv/gZsjNmxe5b8tCB9ybwjP9VN5vxx5BI5cuQgliJcymmprzb7qcZhlKkGS0t9KqMgcw nPWbWvIMFoTkG3TBCqxzRNrijIkCypeS7IiQMF1sDyw+WkWRDPcrWBSSZ1n/pQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1642268843; a=rsa-sha256; cv=none; b=KRgF+wFKnD8t4MZY0jDhB5YpQfPaJvhkS6fvw7pJmtvWBvoXrnfjrwY/WJ4brPlzEGH4jU /a32Vq1EDtAVA26Ji/xqHNmsaZ6e0KI2Ku52WC4mUaYBLD6c38tV9yTP0wXWRRtO0vtmC6 rspGJKCFNZjqbd5V/vLrEwYoDxRj0DNwCQgxTGYJ8YKucT9Z6iGtVeddaxjad8f8sao7kX mnyGB7ZZC4kg0gic2OM8tbupdwWJ6rr2y+/LePhTpY1VoDq/B9ohxdIfa8ATvbu9xfm3Zk kOWAeM70DzRkZmuUIvG/s/rVxljVz+C17X7UuRX/xigKZ+o7AYIQWaT0VRXWMA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=posteo.net header.s=2017 header.b=gnnwIVOZ; dmarc=fail reason="SPF not aligned (strict)" header.from=posteo.net (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -2.23 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=posteo.net header.s=2017 header.b=gnnwIVOZ; dmarc=fail reason="SPF not aligned (strict)" header.from=posteo.net (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: B89B739DB4 X-Spam-Score: -2.23 X-Migadu-Scanner: scn1.migadu.com X-TUID: zLHeQGr8GYXV 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 imp= rove/ 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 m= aybe 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 path= s 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=3D$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 w= ay. 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.=20=20=20 I also remember reading, when researching the problem with kitty sudo emacs, possibilites for preserving chosen environment variables when switch= ing 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 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-termina= l-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 thing= s 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 =E2=80=98belongs=E2=80=99 to info= readers, > LIBRARY_PATH etc. to compilers, ...). > > A downside is that setting it here can be =E2=80=98too late=E2=80=99. > 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 te= rminal > emulators that don't do (1) like kitty? > > Greetings, > Maxime