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

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

Related

How to disable Vim freezing on Windows

I started using Vim actively and as any Windows user I came across problem subconsciously pressing CTRL + S which freezes the screen for some time (at least it seems so). I read different pages on how to exit this mode. It seems that CTRL + Q or CTRL + S help, but it's not a solution. I read that there's a possibility to disable this mode at all, but most of the suggestions concern Linux. How do I do it on Windows?
This has nothing to do with programming or Linux or Windows or even Vim, which doesn't even handle that key combination to begin with.
CTRL-S is usually handled by your terminal emulator for flow control and if that's the case, CTRL-Q as well. If you want that feature disabled, you will have to do it at a lower level, either in your terminal emulator's options or in your shell config file but you didn't mention your terminal emulator or your shell so you are on your own, now.

Copy/pasting feature in codeblocks in linux

I have installed Code::Blocks 12.11 in my linux mint but pasting input at runtime in the command line(I think it is called command line)doesn't seem to work.I have to type the whole input inorder to get output.Can anybody tell me how to fix this?
P.S :- I have tied ctrl+V as well as right click and paste but nothing really working in my case
This problem arises when you have xterm as your launch terminal.You can solve this by switching your terminal from xterm to gnome-terminal.
Go to Settings -> Environment -> Terminal to Launch Console Programs
and change the launch terminal from xterm to gnome terminal from the options.
In the terminal, for copy and paste:
Shift+Ctrl-c and Shift+Ctrl-v
In the Xterm, for pasting:
Middle click or Shift-Insert
if you want to copy in the xterm, you just select the text with your mouse and paste using the middle click or Shift-Instert, but it just works inside the xterm.

Odd behavior of backspace in Vim (SSH to Linux from Mac)

I didn't change any setting of my Vim, but today the Backspace gets some crazy behavior. Every time when I hit it, it does not delete a character, but prints ^?. Anyone knows what is going on?
Not sure why it would randomly start doing this based on the information you gave, but trying adding this line to your .vimrc
set backspace=start,eol,indent
The problem comes from the communication between Mac Terminal the Linux Terminal.
Go to the Mac Terminal -> Preferences -> Advanced tab, check the option "Delete sends Ctrl-H". Then after I login to Linux, and Backspace works just fine in Vim.
In Mac Mavricks and Yosemite Open a terminal, then command+, for preferences, click on the profile tab, click on the -keyboard- menu, then add +
Key: very bottom, <= Delete
Modifier: ^ Control
Action: Send Text
Text: H
click Ok

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.

Creating a ctrl+tab keybinding in PuTTY

I'd like to be able to map the vim commands :tabnext and :tabprev to CTRL+TAB and CTRL+SHIFT+TAB respectively. Unfortunately, I seem to be running into the problem where PuTTY eats these character combinations.
I've tried searching for information, but to no avail. I'm pretty sure this is a PuTTY thing but there doesn't seem to be any sort of help/reference area for the application.
I am curious if anyone here has any experience or suggestions for figuring this out.
#rmeador: try mapping the key combo within vim.
I have attempted to do this, but it doesn't appear like vim is getting the combo. I'm not certain if this is related to the term settings or an issue with PuTTY.
PuTTY doesn't send anything when you press Ctrl+Tab.
You can patch PuTTY as it is described here: Using Ctrl+Tab in GNU Screen over PuTTY
I believe that at this time, using Ctrl+Tab is not possible with PuTTY, because PuTTY does not allow you to configure specific translations for keys. Here is a decent article that shows how you would set this up if PuTTY did support this feature:
http://www.staldal.nu/tech/2009/01/10/how-to-use-ctrl-tab-in-gnu-screen/
If you use (or would consider using) a hotkey/macro program like Autohotkey, you could emulate this behavior yourself. For example, this Autohotkey config script would do exactly what you want:
#IfWinActive PuTTY
^Tab::Send :tabnext
^+Tab::Send :tabprev
#IfWinActive
(Note that this example is just looking for any window title starting with PuTTY, so you'd have to adjust based on your title configuration.)

Resources