Questions tagged [term]

is for the Emacs text terminal emulator, which by default runs in a sub-shell in a buffer named `*terminal*` with `term-mode`. `M-x term` command starts a terminal.

Filter by
Sorted by
Tagged with
0 votes
0 answers
33 views

How can I bind a prefix key to escape term-line-mode?

I've figured out how to get out of char mode, but not the other way around;) #+begin_src elisp (with-eval-after-load 'term ;Terminal Orientation ;(define-key term-raw-map (kbd "C-M-e o l"...
Jason Hunter's user avatar
0 votes
1 answer
34 views

`term` often gets filled with random character codes, any suggestion on how to fix it?

I'm running doom emacs, and here's an example of a command I ran and the resulting output. For some reason, term gets filled with these random character codes. Any suggestions on how to fix this?
shintuku's user avatar
  • 121
0 votes
1 answer
93 views

When using ssh in term-mode, how do I get the remote system's hostname for emacs?

I regularly use term-mode then ssh into a remote machine to run bash commands. I want to display the remote machine's hostname in my modeline. I added the relevant code for the modeline but I'm having ...
Matt's user avatar
  • 3
0 votes
1 answer
149 views

How do I quit vterm's command history searching and start editing the command line?

vterm can search the command history by sending C-r to terminal process, but the command line cannot be modified unless it is executed as it is once. In other words, the string to search keeps ...
roomworoof's user avatar
0 votes
0 answers
26 views

When running `term` in standalone emacs on OSX, how can I copy output?

This question maybe sounds a bit strange, but I can't for the life of me work out how to copy output from term when it is running in the standalone version ("standalone" as in when emacs ...
Fergie's user avatar
  • 203
5 votes
0 answers
263 views

run “term” on MS-Windows

I typed M-x term; then Emacs prompted a query string followed by a default pathname: Run program: D:/Progs/emacs-29.1/libexec/emacs/29.1/x86_64-w64-mingw32/cmdproxy.exe Directly typed <return>. ...
shynur's user avatar
  • 5,194
3 votes
2 answers
211 views

Can Emacs render shell escape codes stored in a GNU Screen session log file?

The GNU Screen utility has the ability to log all shell output to a file, a useful feature to log the output of a long running build system, for instance. The log file generated by GNU Screen ...
PRouleau's user avatar
  • 796
1 vote
2 answers
83 views

How to prevent the character `^[(B` from being displayed on the compilation buffer

When I run the test feature of Rust in Emacs compilation mode, with ansi-color mode loaded, somehow the character ^[(B is always displayed like below: It looks quite annoying. Does anyone know how to ...
Trung Ta's user avatar
  • 301
0 votes
1 answer
17 views

strange squares in term mode

For some time I have been seeing strange squares on term-mode Here a example with 'top' command I am using emacs 28.2.50 with -q option. Any ideas ?
djangoliv's user avatar
  • 3,189
0 votes
1 answer
29 views

Hide divider when opening minimap

I would like disable divider-mode when enabling minimap-mode. How do I ?
mcp's user avatar
  • 67
1 vote
1 answer
1k views

Opening file in emacs buffer when using vterm

My current workflow is often to do things in a terminal and open/change relevant files in a text editor. Transitioning from VSCode to Emacs I am looking for a similar workflow that I got used to when ...
Johannes Nauta's user avatar
2 votes
1 answer
117 views

How to execute a command in elisp (startup script) whenever a new term is created?

I tried adding hook to term-mode-hook to call comint-send-string: (add-hook 'term-mode-hook (lambda () (comint-send-string (get-buffer-process (current-buffer)) "alias t='echo test'&...
AhLeung's user avatar
  • 1,083
0 votes
2 answers
81 views

After establishing a SSH connectia via eshell, "dumb" terminal can't run Emacs. Also vi does not work properly. How to solve this with Emacs?

After running eshell, I was trying to establish a SSH connection and do some changes on the server: ssh [email protected] The connection was successfully established (the real IP address was ...
Pedro Delfino's user avatar
0 votes
1 answer
40 views

A comparitive analysis of shell, eshell, and term: what are the similiraties? What are the differences between them? When to use each of them?

This question was previously answered in Unix Stack Exchange. It has not been answered here, in Emacs Stack Exchange. I believe new answers in a community fully dedicated to Emacs could go deeper. But ...
Pedro Delfino's user avatar
1 vote
1 answer
207 views

Why does `eshell` not create an active process In Emacs while `shell` and `term` do?

In Emacs, the features shell, term, and eshell are different commands used for similar goals. When executed, shell and term create active processes in Emacs. I expected the same for eshell. However, ...
Pedro Delfino's user avatar
0 votes
1 answer
86 views

How to enable terminal beeping?

xterm conviniently beeps on a failed unit test (pytest): Beeping (start-process "" nil "/usr/bin/xterm" "-e" "python3" "-B" "-m" "...
jjk's user avatar
  • 731
0 votes
2 answers
274 views

Why does htop command does not work on *shell*?

I tend to prefer shell over term. With shell everything is text and I can use the Emacs bindings to move around. Also, I have been trying to avoid opening my nixOS terminal. I have been trying to stay ...
Pedro Delfino's user avatar
1 vote
0 answers
48 views

How can I change buffer local key binding C-h, C-x, M-x in term raw mode?

I'm running a specific console application in a term window (char/raw mode). This application has no need for C-h, C-x, and M-x, so they should just do what they always do in Emacs. However, I don't ...
fred's user avatar
  • 21
0 votes
0 answers
170 views

How to have a multiple line prompt terminal?

Using mainly ansi-term,term or vterm I'd like the prompt to contain a line with informations for directory,user and git, whilst the actual input prompt line to be below. I've heard of zsh though doubt ...
jjk's user avatar
  • 731
-1 votes
1 answer
134 views

Using after-change-functions for an ansi-term buffer

I'm writing some Elisp that compiles code in watch mode using make-term. When the code compiles/tests pass, the compilation output is only a couple of lines. When there's an error, it can be much ...
rlms's user avatar
  • 99
3 votes
1 answer
544 views

How to make 'term' close the buffer when the process exits?

When I press Ctrl-D in a 'term', the buffer stays open with the text "Process terminal finished". How can I make this buffer close instead of staying open with this text displayed? Note, ...
ideasman42's user avatar
  • 8,756
0 votes
1 answer
89 views

How to launch 'term' with my default shell without a prompt to select the shell?

I would like to launch term with my default shell, without being prompted every time for the path of the shell. How can I bind a key to term without being prompted for the shell to run?
ideasman42's user avatar
  • 8,756
0 votes
0 answers
633 views

Interactive terminal solution for Emacs on Windows?

I recently tried to move from over to Emacs but hit a brick wall while trying to setup a terminal. While shell and eshell work fine, they are not really interactive so you can't really run things such ...
daedsidog's user avatar
  • 157
2 votes
1 answer
412 views

Prevent term from asking me which shell to use

I want to use /bin/bash as default shell for term avoiding it to ask me every time. Is this possible?
Francesco Cadei's user avatar
1 vote
2 answers
286 views

How to open `crontab -e` in emacs terminal editor?

I am trying to open crontab -e in emacs terminal editor, but it keeps opening it as GUI. After running crontab -e emacs windows pops up rather than opening it as terminal editor. $ crontab -e no ...
alper's user avatar
  • 1,350
0 votes
0 answers
30 views

Create term horizontal split that is 20% size key binding

I'd like a key binding that can create a term buffer in a 25 percent split. What I mean by that is, with a specific key binding like SPC t c, I'd like to open up a terminal in a split.
abhinav chavali's user avatar
0 votes
1 answer
148 views

What is the keycode of C-TAB?

iTerm does not send ctrl+tab itself, so I need to configure it myself. I can't figure it what key code ctrl+tab is though.
HappyFace's user avatar
  • 830
0 votes
0 answers
49 views

Switch Emacs default shell from bash to zsh or fish [duplicate]

When I deleted the zsh shell to move to fish, alot of my emacs configuration got messed up. It won't recognize my racer (Rust autocomplete) or do syntax highlighting. When I run doom reload, it gives ...
abhinav chavali's user avatar
1 vote
1 answer
344 views

How can I bind F12 in serial-term mode to minicom's F12?

When I use emacs serial-term mode Can I invoke F12 or other function keys as minicom's F12? I tried below... but it doesn't work (global-set-key [f12] nil) Thank you in advance!
hyuk myeong's user avatar
1 vote
1 answer
346 views

Wait for result of fzf without blocking input

I'm trying to make use of the fzf fuzzy finder to search through a list via a term process. The way I do this is very similar to fuzzy-finder.el or fzf.el. This is by launching fzf with: (progn (...
MHilton's user avatar
  • 131
0 votes
1 answer
106 views

Emacs' C-tab seems without effect on my server through ssh

(Emacs 27.1) On my local machine <C-tab> is linked to other-window and works well: .emacs.d/init.el: (global-set-key (kbd "<C-tab>") 'other-window) When I install Emacs on a (...
suizokukan's user avatar
0 votes
0 answers
40 views

Weird UI of term in Doom

My terminal in Doom looks like shown in picture but I can't seem to find a way to solve this. I have term activated in my init.el
DiogoJDO's user avatar
2 votes
1 answer
132 views

Elisp - Changing directory in shell buffer

I want to open an instance of a terminal emulator (in my case term) and go to a specific directory, all with a single Elisp function. My idea was to send a specific string programmatically to the ...
Andrea's user avatar
  • 173
0 votes
1 answer
94 views

Setting `scroll-margin` for `term-mode` using `unless` is not working

I want to set default value of scroll-margin to 3 but for ansi-term I want it to be 0. To do this I have added a hook to term-mode-hook which worked fine. (setq scroll-margin 3) ...
Chinmay Chhajed's user avatar
0 votes
1 answer
65 views

Why does `term-emulate-terminal` get executed every time `read-from-minibuffer` gets executed?

Why does term-emulate-terminal get executed every time I execute counsel-switch-buffer if and only if the *terminal* buffer is open in a window. If the *terminal* buffer is not in a window term-...
John DeBord's user avatar
1 vote
0 answers
111 views

Why does calling `term-send-backspace` (just pressing backspace) create a newline in the `*terminal*` buffer in `term-mode`?

Specs: i@debord:~$ emacs --version GNU Emacs 26.3.50 Copyright (C) 2019 Free Software Foundation, Inc. GNU Emacs comes with ABSOLUTELY NO WARRANTY. You may redistribute copies of GNU Emacs under the ...
John DeBord's user avatar
1 vote
1 answer
242 views

M-x compile hangs with WARNING: terminal is not fully functional

I have been using M-x compile for ages. Lately (our sysadmin has updated many things) it hangs after giving this message: WARNING: terminal is not fully functional - (press RETURN). Pressing return ...
Gopal Patnaik's user avatar
1 vote
1 answer
61 views

How to override Q in term-mode with passthrough if the shell process is still live?

I wrote the following emacs lisp procedure to kill a dead ansi-term buffer. It works well if called with M-x. Also, it appears to run correctly when the called in a living term buffer. However, dead ...
wdkrnls's user avatar
  • 3,707
0 votes
0 answers
21 views

How to wrap visual program with term? [duplicate]

I have installed visidata and am trying to integrate into my Emacs workflow through term-mode. As a proof of concept, I'm trying to successfully explore the mtcars data set as it would work when ...
wdkrnls's user avatar
  • 3,707
0 votes
0 answers
772 views

Python : name '__file__' is not defined

So as you can see, in my terminal, I was able to execute the file without error, but once I tried from the python shell, whether in the terminal or the one integrated in Emacs, there is an error, it ...
sinekonata's user avatar
1 vote
0 answers
127 views

emacs -nw & gnome-terminal or xterm: can't distinguish C-M-v and C-M-S-v

emacs (v.26.3) can distinguish, out of the box, C-M-v (scroll-other-window) and C-M-S-v (scroll-other-window-down). On the other hand, emacs -nw, when run in either gnome-terminal, mate-terminal or ...
Diagon's user avatar
  • 133
0 votes
2 answers
551 views

How to get kill-buffer-hook to detach a screen session prior to kill-buffer?

I keep many screen session running in the backgroud, which I access with M-x eshell-command "screen -r <myscreen>". Before I kill the *screen* buffer, I have to detach the session with C-a d. ...
petermao's user avatar
2 votes
0 answers
40 views

How to restore a coding environment?

Every other day I continue work on a coding project which involves these steps: Open a file in the project Open a terminal buffer e.g.: m-x term Change to that term buffer Enter command in termin e.g....
jjk's user avatar
  • 731
0 votes
0 answers
1k views

How do I stop a process with Ctrl-C in Term?

I'm very new to Emacs. I've opened a terminal with M-x term, and started a server running on localhost. It says Press CTRL+c to quit. However, Ctrl-C appears to be mapped to Emacs commands. How can I ...
Josh Friedlander's user avatar
0 votes
3 answers
2k views

How can I use Emacs and iTerm for the same key binding?

In my .emacs file I have also set ctrl-o to delete a word: (defun backward-delete-word (arg) "Delete characters backward until encountering the beginning of a word. With argument ARG, do this ...
alper's user avatar
  • 1,350
0 votes
1 answer
374 views

How to quit serial-term?

I opened a serial-term to /dev/ttyUSB0. I can't quit it. C-x k results in the following message: term-quit-subjob: Process /dev/ttyUSB0 is not a subprocess
Harvey's user avatar
  • 978
0 votes
1 answer
98 views

How do I open a .gpg file from the command line?

I have a file located in the directory ~/myfiles/list.txt.gpg. In the terminal, I type emacs ~/myfiles/list.txt.gpg and I get something that looks like this, which I'm guessing is the still encrypted ...
Hitomi86's user avatar
0 votes
0 answers
255 views

Send command to run in eshell, after compiled

So I've been mapping my M-x compile like this, according to c-mode-hook or c++-mode-hook: (add-hook 'c++-mode-hook (lambda () (set (make-local-variable 'compile-command) ...
mle0312's user avatar
  • 295
0 votes
0 answers
49 views

Record command into bash source block using asciinema and org-babel

As you perhaps know, asciinema rec (asciinema rec path/to/file) and generate an asciicast file which contain all commands recorded on terminal. I think using asciinema to replay this file (asciinema ...
reyman64's user avatar
0 votes
1 answer
158 views

How to show colours and clear when running React development server in eshell?

Here is how the usual Ubuntu terminal looks when you run the React development serving using npm start and make changes to your source: Say the server was already running and you tried to do npm ...
scribe's user avatar
  • 1,025