Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Mark Mikulec
October 14, 2003, 1:32 am
rate this thread
I've been using Putty for a very long time, and it's a wonderful ssh
client - but there's been an issue that's been hanging around in the
last couple of versions that a real pain in the ass. And I'm not
totally sure if it's putty at fault or my vi settings..
When I copy any text data (in Putty, Notepad or anywhere else) and I
paste it in another location in my editor for every new line it adds
another tab, so something like the following:
Would be pasting in like so:
Very very annoying when trying to move around large block of code. Has
anyone seen behaviour like this? And know how to fix it?
Re: Putty: pasting text adds additional whitespace
This is likely not to be PuTTY at all. When you paste text in PuTTY,
it behaves exactly as if you'd typed the same text into the keyboard
(that's the only way it can possibly work).
In this snippet, you have a few spaces before each line of text. So
this is equivalent to typing SPACE SPACE foo RETURN SPACE SPACE foo1
RETURN SPACE SPACE foo2 RETURN.
This suggests that your editor has auto-indent enabled, so that when
you press RETURN it indents to the same level as the previous line.
So you hit RETURN after foo, and it brings the cursor to exactly
where it would want to be to type "foo1", but PuTTY is sending
another two spaces before that. And so on.
I don't think there's any sensible way that PuTTY, or any other
terminal emulator with copy and paste, could be `fixed' to work
around this. The solution is to disable auto-indent in your editor
when you're doing this sort of pasting.
Simon Tatham "infinite loop _see_ loop, infinite"
- » ssh on command line: force using a group size (prime size) of 1024 (and no...
- — Newest thread in » Secure Shell Forum