[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using Emacs in fbterm.

From: Gregory Heytings
Subject: Re: Using Emacs in fbterm.
Date: Tue, 30 Aug 2022 12:04:24 +0000

But since fbterm doesn't always announce itself as such, but instead calls itself "linux", this is not reliable enough, is it?

It is. There are two cases: if it calls itself "linux", you get eight colors, and everything works as expected with those eight colors. If it calls itself "fbterm", you get wrong colors (without the patch).

(And of course we can also tell users to set TERM=fbterm in the FAQ entry.)

And how can I check whether compositions should be disabled, that is, if they confuse cursor movement?

There are some compositions in HELLO, and you can also try some long Emoji sequences.

As far as I can tell, cursor movement works as expected with auto-composition-mode t.

So I suggest the following patch, with an additional note in the FAQ entry.

diff --git a/lisp/term/fbterm.el b/lisp/term/fbterm.el
new file mode 100644
index 0000000000..2e66bb72c0
--- /dev/null
+++ b/lisp/term/fbterm.el
@@ -0,0 +1,21 @@
+;;; fbterm.el  -*- lexical-binding:t -*-
+(require 'term/xterm)
+(declare-function gpm-mouse-enable "t-mouse" ())
+(defun terminal-init-fbterm ()
+  "Terminal initialization function for fbterm."
+  ;; fbterm can't display underlines, even though its terminfo data
+  ;; says it can.
+  (tty-no-underline)
+  ;; fbterm supports xterm's 256 color mode extension.
+  (xterm-register-default-colors xterm-standard-colors)
+  (ignore-errors (when gpm-mouse-mode (require 't-mouse) (gpm-mouse-enable))))
+(provide 'term/fbterm)
+;;; fbterm.el ends here

reply via email to

[Prev in Thread] Current Thread [Next in Thread]