GNU bug report logs - #44272
guix edit doesn't work when $EDITOR is set to "kate"

Previous Next

Package: guix;

Reported by: Nathan Dehnel <ncdehnel <at> gmail.com>

Date: Wed, 28 Oct 2020 06:14:01 UTC

Severity: normal

Done: zimoun <zimon.toutoune <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Simon Tournier <zimon.toutoune <at> gmail.com>
To: Leo Prikler <leo.prikler <at> student.tugraz.at>
Cc: ncdehnel <at> gmail.com, 44272 <at> debbugs.gnu.org
Subject: bug#44272: guix edit doesn't work when $EDITOR is set to VSCode
Date: Mon, 06 Nov 2023 18:41:20 +0100
Hi,

On Thu, 02 Nov 2023 at 10:32, Simon Tournier <zimon.toutoune <at> gmail.com> wrote:

> (define %vscode--goto "code --goto ")

In case, here an improvement when using Remote-SSH.

--8<---------------cut here---------------start------------->8---
(define %vscode--goto
  (let* ((vscode-server (string-append (getenv "HOME") "/.vscode-server"))
         (code (if (file-exists? vscode-server)
                   ;; Maybe Remote-SSH
                   (let* ((vscode-server/bin (string-append vscode-server "/bin"))
                          (hash         ;Guess the correct identifier
                           (car
                            (scandir vscode-server/bin
                                     (lambda (file)
                                       (not (member file (list "." ".."))))
                                     (lambda (x y)
                                       (> (stat:mtime
                                           (lstat (string-append vscode-server/bin "/" x)))
                                          (stat:mtime
                                           (lstat (string-append vscode-server/bin "/" y))))))))
                          (vscode (string-append
                                   vscode-server/bin "/" hash "/bin/remote-cli/code"))
                          (run/user/uid (string-append "/run/user/"
                                                       (number->string (getuid))))
                          (socket       ;Guess the correct socket
                           (car
                            (scandir run/user/uid
                                     (lambda (file)
                                       (string-prefix? "vscode-ipc" file))
                                     (lambda (x y)
                                       (> (stat:mtime
                                           (lstat (string-append run/user/uid "/" x)))
                                          (stat:mtime
                                           (lstat (string-append run/user/uid "/" y)))))))))
                     (string-append
                      "VSCODE_IPC_HOOK_CLI=" socket " " vscode))
                   ;; No Remote-SSH, try to find the local one in PATH
                   (search-path (string-split (getenv "PATH") #\:)
                                "code"))))
    (string-append code " --goto ")))
--8<---------------cut here---------------end--------------->8---


Cheers,
simon




This bug report was last modified 1 year and 239 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.