X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 	tests=AWL,BAYES_00,SPF_PASS
X-Spam-Check-By: sourceware.org
X-IronPortListener: Outbound_SMTP
From: "Buchbinder, Barry (NIH/NIAID) [E]" <BBuchbinder@niaid.nih.gov>
To: "cygwin@cygwin.com" <cygwin@cygwin.com>,
   "'Ralf Gans'" 	<Ralf.Gans@NSG-GmbH.de>
Date: Mon, 2 Feb 2009 15:16:21 -0500
Subject: RE: Copy converts tabs to spaces ?
Message-ID: <0105D5C1E0353146B1B222348B0411A2182F4DC2@NIHMLBX02.nih.gov>
References: <WorldClient-F200902021105.AA05540020@butn.net>  <A45AE599-B6AC-41DA-A230-CD3C1C7A4F67@NSG-GmbH.de>
In-Reply-To: <A45AE599-B6AC-41DA-A230-CD3C1C7A4F67@NSG-GmbH.de>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

Ralf Gans wrote on Monday, February 02, 2009 8:57 AM:
> On 02.02.2009, at 11:05, xerces8 wrote:
>> I noticed that when copying text from a the Cygwin Bash window and
>> then pasting it somewhere (like WordPad), tabulator characters are
>> converted to spaces.
>>
>> The same happens with RXVT too.
>>
>> Details:
>> - print the content of some text file that has tabs (like a C
>> program source) : cat foo.c
>> - select and copy the text with the mouse
>> - paste (ctrl-V) into WordPad
>>
>> The text in Wordpad has no more tabs.
>>
>> Is there a way around this ?
>
> copy an paste from window to window takes what's printed, not what
> you have written.
>
> So, if the terminal prints spaces to represent the tabs, as a
> terminal usually does, you CAN only copy spaces.
>
> All else is an exception, U*X ist NOT wysiwyg!

Think about using putclip instead.

  $ cat foo.c | putclip -d
  $ putclip -d < foo.c
  $ putclip --help
  putclip version 0.2.0
    Copy stdin to the Windows Clipboard

  Usage: putclip [OPTION...]

  General options
    -d, --dos         Clipboard text will have DOS line endings.
    -u, --unix        Clipboard text will have UNIX line endings.
    -n, --no-conv     Do not translate line endings.

  Help options
    -?, --help        Show this help message
    --usage           Display brief usage message
    --version         Display version information
    --license         Display licensing information
  NOTE: by default, no line ending conversion is performed.

You also might want to familiarize yourself with getclip.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

