Serial terminal in emacs - linux

I'm working on and embedded system with a serial (RS232) console. (With a Linux desktop) I would like to connect to the serial port in emacs and be able to navigate the output with my normal emacs navigation (search / copy / yank / etc )
I am currently doing this with ansi-term + GNU Screen.
However, I cannot get the GNU Screen navigation to my liking.
Any suggestions??

I'm not sure how GNU screen fits into the equation but have a look at serial-term.
Use C-cC-k to go to char mode and C-cC-j to go to line mode (where your normal bindings apply).
Killing the buffer closes the port (C-ck in char mode, C-xk in line mode).

This page covers using screen with ansi-term under emacs: GnuScreen

Related

Changing the keybindings for virtual terminals in Raspbian Lite

When using a virtual terminal (TTY) on Linux, there are certain keybindings that are redundant on modern keyboards. For example, Ctrl+J and Enter do the same thing (Linefeed).
I would like keys like Enter to retain their current mapping, freeing up stuff like Ctrl+J for something else.
On Raspbian Lite (basically, Debian), is it possible to map Ctrl+J to something different to Enter?
There are five man pages you should start with when learning about keymaps:
See keymaps(5) for defining custom keymap files.
See dumpkeys(1) to explore the state of the current keymap.
See showkey(1) to detect which keycodes your keyboard emits.
See loadkeys(1) to load a different keymap into the kernel.
See install-keymap(8) to persistently update the system keymap.
Note: This information relates to the virtual terminals that the kernel provides. Some things are different with X (see XKB).

Number pad issues when using a remote 'nano' instance in PuTTY

I'm using PuTTY on an old Windows laptop to communicate with Ubuntu.
When using the terminal, everything is fine and I can use the numpad normally. However, when I open anything in nano, all these keys have functions instead of numbers.
I did a search about this and found a few solutions to change PuTTY settings, but they didn’t have any effect. Is this an issue with PuTTY or with nano?
For anyone else with this problem—this is PuTTY specific and is caused by the application keypad mode sending escape sequences to nano.
To solve it:
From an open PuTTY terminal:
Ctrl + right-click to bring up the context menu
Select "Change Settings..."
Select Terminal → Features in the left-hand navigation tree
Check "Disable application keypad mode"
Reference: Description of bug on the Vim (FANDOM.com??) wiki
nano uses the curses keypad function, turning it on (so that curses handles cursor-keys). The terminal description turns on application mode for both the cursor-keys and the numeric keypad, which with PuTTY makes it send the non-numeric stuff.
You could modify the terminal description to remove the numeric-keypad part of the smkx capability:
infocmp -1 >foo
vi foo
... look for smkx=\E[?1h\E=,
... change that to smkx=\E[?1h,
tic foo

How to Split Screen Emacs and Terminal

everyone.
I use PuTTY and I am wondering if it's possible to open an emacs text file in split screen with the terminal window.
I looked everywhere for the answer, but all I've found is how to have two emacs windows open, and I would like to be able to see and switch between the terminal window and an emacs file.
Thanks.
You could use the region feature in screen rather than using the split screen within emacs... but then you might want to rebind the escape key in screen.

Can't write English in xterm terminal

My keyboard has two languages, English and other. But in xterm I can write only in other language, and I can't replace the language in any way (alt-lshift, the regular way, or in the gui). With shift key I can write upper case (with caps lock it doesn’t work).
The Cygwin guides on the internet referrals me to xkb layout files, that doesn't existing in my computer at all.
I open the xterm from the icon of Xwin.
Thank you.
Since this is an XTerm running in the Cygwin X server, the X server is doing all the keyboard input translation, independently from the keyboard translation Windows does for other programs (the X server reads the raw keyboard input from the device). So you have to use the X11 methods of changing keyboard layouts. Into your .xinitrc or .xprofile (I can't remember which one Cygwin uses) put the following command
setxkbmap us
To load the US keyboard layout. You can type it also from your xterm when you need it. Read the manpage of setxbmap for details.

Cygwin non-US or indirect characters don't work in xterm on extra monitor

I have run into this freaky thing in two places now, on a Windows 7 and an XP machine.
I have a laptop with an extra monitor connected. I start up cygwin's x-server, using the start menu shortcut (Cygwin-X/XWin Server). I then start an xterm by right-click the X icon in the icon tray at the bottom right, and selecting Applications/xterm.
I get an xterm. In it I can type text, but depending on which monitor the xterm window resides, all characters that require two keypresses on my swedish keyboard (example: "~" requires me to first press alt+the key marked "^ ¨ ~" and then press space, rendering a single ~ on the screen) result in a space being printed.
If I move the xterm to the other monitor, I am suddenly able to type a ~ in the xterm. Move it back to the previous monitor, and I can't type ~ anymore.
Weird or what? This is the problem I have now, on my XP laptop. On my Windows7 laptop (same basic setup) I had the problem that I could only type stuff like åäö (not indirect/combined characters - I have keys marked å, ä and ö respectively on my keyboard) on one monitor, not the other.
I have messed around with different ways to start up the X Server, I think I am doing it the right way as I describe here.
My cygwin installation is maybe a year old on both machines. I would like to be able to find whatever setting causes this behaviour, so I can handle it should I come across similar problems in the future.
Any ideas?
Edit: some stuff that looked like html tags got mangled.
Since this seems to be a problem only with xterm, as a simple workaround I would suggest using some other terminal emulator instead of xterm. On Cygwin, a really nice substitute is mintty (available as a Cygwin package from within Cygwin setup). I stopped using xterm in favor of mintty some time ago because I found it to simply be an all-around more useful terminal emulator.
As a possible side benefit of using mintty, if xterm is the only X application you typically use, then you don't even need to run an X server any more because mintty is not an X application.

Resources