davidshepherd7 / terminal-here

An Emacs package to open an external terminal emulator in the current directory
GNU General Public License v3.0
73 stars 12 forks source link

Add support for gnome-console #40

Closed juergenhoetzel closed 8 months ago

juergenhoetzel commented 8 months ago

GNOME Console replaced gnome-terminal in the Arch Linux gnome package group.

Startup terminal-here fails

  Debugger entered--Lisp error: (file-missing "Searching for program" "Datei oder Verzeichnis nicht gefunden" "gnome-terminal")
  #<subr make-process>(:name "gnome-terminal" :buffer nil :command ("gnome-terminal"))
  make-process--with-editor-process-filter(#<subr make-process> :name "gnome-terminal" :buffer nil :command ("gnome-terminal"))
  apply(make-process--with-editor-process-filter #<subr make-process> (:name "gnome-terminal" :buffer nil :command ("gnome-terminal")))
  make-process(:name "gnome-terminal" :buffer nil :command ("gnome-terminal"))
  start-process("gnome-terminal" nil "gnome-terminal")
  apply(start-process "gnome-terminal" nil "gnome-terminal")
  (let* ((default-directory dir) (process-name (car command)) (proc (apply #'start-process process-name nil command))) (set-process-sentinel proc #'(lambda (proc _) (if (and (eq (process-status proc) 'exit) (or (/= ... 0) terminal-here-verbose)) (progn (message "In terminal here, command `%s` exited with error c..." (mapconcat ... command " ") (process-exit-status proc)))))) (set-process-query-on-exit-flag proc nil))
  terminal-here--run-command(("gnome-terminal") "/home/juergen/emacs/site-elisp/")
  (let* ((local-dir (if (file-remote-p dir) (terminal-here--tramp-path-to-directory dir) dir)) (ssh-data (terminal-here--parse-ssh-dir dir)) (terminal-command (if ssh-data (terminal-here--ssh-command ssh-data) (terminal-here--get-terminal-command local-dir)))) (if (and ssh-data inner-command) (progn (user-error "Custom commands are not currently supported over s..."))) (terminal-here--run-command (append terminal-command (if inner-command (progn (list (terminal-here--get-command-flag)))) inner-command) local-dir))
  terminal-here-launch-in-directory("/home/juergen/emacs/site-elisp/" nil)
  terminal-here-launch()
  funcall-interactively(terminal-here-launch)
  command-execute(terminal-here-launch record)
  #<subr execute-extended-command>(nil "terminal-here-launch" "termi")
  ad-Advice-execute-extended-command(#<subr execute-extended-command> nil "terminal-here-launch" "termi")
  apply(ad-Advice-execute-extended-command #<subr execute-extended-command> (nil "terminal-here-launch" "termi"))
  execute-extended-command(nil "terminal-here-launch" "termi")
  funcall-interactively(execute-extended-command nil "terminal-here-launch" "termi")
  command-execute(execute-extended-command)

I don't see a simple solution to this problem because there is a 1-to-1 relationship between DESKTOP_SESSION and terminal program in terminal-here--pick-linux-default.

Workaround:


(use-package terminal-here
  :ensure t
  :custom
  (terminal-here-terminal-command '("kgx"))
  (terminal-here-command-flag  "-e"))
davidshepherd7 commented 8 months ago

Thanks for raising this!

I think if it looks like a gnome environment we could check which of gnome-terminal or gnome-console exists with executable-find.

~Do you know if the gnome-console executable is always called kgx?~

Edit: looks like yes https://gitlab.gnome.org/GNOME/console/-/issues/119

davidshepherd7 commented 8 months ago

I've hopefully pushed a fix but it's hard for me to test since I don't use Arch. Let me know if it works please :)

juergenhoetzel commented 8 months ago

I've hopefully pushed a fix but it's hard for me to test since I don't use Arch. Let me know if it works please :)

I can confirm: it works fine. Many thanks for the quick fix :+1: .