summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Heytings <gregory@heytings.org>2022-08-29 16:06:37 +0000
committerGregory Heytings <gregory@heytings.org>2022-08-29 20:46:29 +0200
commit2d9a39172734ab024126fb08496b5272d1b68e47 (patch)
tree41c4bcd18a66ca9da43a7f9ea98d7ae3c8dba852
parenta5a92e577cba1af6a7947bf1f7c020a1b5adb39e (diff)
downloademacs-2d9a39172734ab024126fb08496b5272d1b68e47.tar.gz
Recommend using fbterm in the Linux console.
* doc/misc/efaq.texi (Emacs in a Linux console): New node. (Common requests): Entry for the new node. * etc/PROBLEMS (Linux console problems...): Mention the new FAQ node.
-rw-r--r--doc/misc/efaq.texi85
-rw-r--r--etc/PROBLEMS7
2 files changed, 92 insertions, 0 deletions
diff --git a/doc/misc/efaq.texi b/doc/misc/efaq.texi
index 373efe9ad5f..2da37a1d215 100644
--- a/doc/misc/efaq.texi
+++ b/doc/misc/efaq.texi
@@ -1603,6 +1603,7 @@ is better to write ``Emacs and XEmacs.''
* Filling paragraphs with a single space::
* Escape sequences in shell output::
* Fullscreen mode on MS-Windows::
+* Emacs in a Linux console::
@end menu
@node Setting up a customization file
@@ -3020,6 +3021,90 @@ To compute the correct values for width and height, first maximize the
Emacs frame and then evaluate @code{(frame-height)} and
@code{(frame-width)} with @kbd{M-:}.
+@node Emacs in a Linux console
+@section How can I alleviate the limitations of the Linux console?
+@cindex Console, Linux console, TTY, fbterm
+
+If possible, we recommend running Emacs inside @command{fbterm}, when
+in a Linux console. This brings the Linux console on par with most
+terminal emulators under X. To do this, install @command{fbterm}, for
+example with the package manager of your GNU/Linux distribution, and
+execute the command
+
+@example
+$ fbterm
+@end example
+
+This will create a sample configuration file @file{~/.fbtermrc} in
+your home directory. Edit that file and change the options
+@code{font-names} and @code{font-size} if necessary. For the former,
+you can choose one or more of the lines in the output of the following
+command, separated by commas:
+
+@example
+$ fc-list :spacing=mono family | sed 's/ /\\ /g'
+@end example
+
+You can now start Emacs inside @command{fbterm} with the command
+
+@example
+$ fbterm -- emacs
+@end example
+
+You may want to add an alias for that command in your shell
+configuration file. For example, if you use Bash, you can add the
+following line to your @file{~/.bashrc} file:
+
+@example
+alias emacs="fbterm -- emacs"
+@end example
+
+@noindent
+or, if you use Emacs both in the Linux console and under X:
+
+@example
+[[ "$(tty)" =~ "/dev/tty" ]] && alias emacs="fbterm -- emacs"
+@end example
+
+The @command{fbterm} terminal emulator may define a number of key
+bindings for its own use, some of which conflict with those that Emacs
+uses. Execute the following two commands as root to ensure that
+@command{fbterm} does not define these key bindings:
+
+@example
+# chmod a-s `which fbterm`
+# setcap cap_sys_tty_config=-ep `which fbterm`
+@end example
+
+If you use Emacs as root, the above is not enough however, because the
+root user has all privileges. You can use the following command to
+start Emacs inside @command{fbterm} as root while ensuring that
+@command{fbterm} does not define any key bindings for its own use:
+
+@example
+# capsh --drop=cap_sys_tty_config -- -c "fbterm -- emacs"
+@end example
+
+Again you may want to add a shortcut for that command in the shell
+configuration file of the root user. In this case however, it is not
+possible to use an alias, because the command line arguments passed to
+Emacs need to be inserted in the string at the end of the command. A
+wrapper script or a function can be used to do that. For example, if
+you use Bash, you can add the following function in the root user
+@file{~/.bashrc} file:
+
+@example
+function emacs ()
+@{
+ CMD="fbterm -- emacs "
+ for ARG in "$@@"
+ do
+ CMD="$CMD '$ARG' "
+ done
+ capsh --drop=cap_sys_tty_config -- -c "$CMD"
+@}
+@end example
+
@c ------------------------------------------------------------
@node Bugs and problems
@chapter Bugs and problems
diff --git a/etc/PROBLEMS b/etc/PROBLEMS
index 2a82995c994..9e0b0148ba3 100644
--- a/etc/PROBLEMS
+++ b/etc/PROBLEMS
@@ -2108,6 +2108,13 @@ term/xterm.el) for more details.
*** Linux console problems with double-width characters
+If possible, we recommend running Emacs inside fbterm, when in a Linux
+console (see the node "Emacs in a Linux console" in the Emacs FAQ).
+Most Unicode characters should then be displayed correctly.
+
+If that is not possible, the following may be useful to alleviate the
+problem of displaying Unicode characters in a raw console.
+
The Linux console declares UTF-8 encoding, but supports only a limited
number of Unicode characters, and can cause Emacs produce corrupted or
garbled display with some unusual characters and sequences. Emacs 28