From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5900 invoked by alias); 3 Jun 2015 23:55:28 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 35378 Received: (qmail 20256 invoked from network); 3 Jun 2015 23:55:25 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2 autolearn=ham autolearn_force=no version=3.4.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1433375306; bh=FdQ87oAy2ubfZ1eUptm/cHmrbVs2PoeDvR9GgDOfTlU=; h=In-reply-to:From:References:To:cc:Subject:Date:From:Subject; b=ZeJpfRd3h3YUlCHD2eanngYlt4WKxwDoharc1j99+9XEDUoSNU3V9Porc+Y09Zeam9Xc3/pc+Frd7U/27ALKIT7eJ9EAkxExL/SBNMBmx8D7LA0XJP0mwfKxurqTMAJt0b3IqbROcgSBH4X3cV5ZK7eWE5P6Wi2XTV2PGZJOeM4DHz7YZ0sZ+xJdbab/RdunN246bE5ZvsW9VeMJNbg41ik1Qy2i8j+Bk6lA9yvrxk5MqwKeW/Y6ItIJ3JV8jdEp2jNdW5nlllPN4SkpcBBefshWM4RAg36UXuyv6h3Cv5i3R1DcqmIuFhnQQATDrS8HGl7eVwDPcmt1PhWXq6bS8A== X-Yahoo-Newman-Id: 373883.20094.bm@smtp146.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: 9irIMX8VM1n6pwv..ohYHrwSTCm8AbDRM.bnFd6ems8DrTe QJKzZjwy0ewHRDmjio4Rddyg5xbogZcCQHFoExfje6l3kThsfSc5MKIS_Cfd m9ZXjXFtN6XKrMYp6FLKzUW8lkyCk88ecgOTMfKYDTrKC7Jjuw1obflpt9Xx vQ5BZJ47v1khyX6wFff5nLvD_IUjSU6Clro.WF78Rb6tAM87YPFX9_9AVoRA 1ShAb3uAftCLNJ92s.2Vs6VQ1w9sYAB1OSGGLI69PwVn7_XbNB.KeLvjPiyk mQXdsJisLvGkmju32.DeldHQHT27In2nrtvevRU9SzxXyo9r19KB336ngQ9m GPl5KPBeNtCZuurlpDfWvexXHEgdY.L.vQuPcsQdkmxkGPPON8MF.xrx1886 8H_84Tmu8HLM8lUnkY8EiZrJ7_smT65QCOme_IxiQ0F6.sD4PsG5J8mfk82e nXrCyUb21GYcElTvhVC9rjcPwA_qfIwGlbBi5IUHou7bC1iSTH9cERlyb2Ju ApbRgzEPTCJj3.g3C6LGt.ugpkEHGlAmM X-Yahoo-SMTP: opAkk_CswBAce_kJ3nIPlH80cJI- In-reply-to: <20150603204258.GE4767@chaz.gmail.com> From: Oliver Kiddle References: <55677AF5.50709@thequod.de> <27004.1433345491@thecus.kiddle.eu> <20150603204258.GE4767@chaz.gmail.com> To: Stephane Chazelas cc: Zsh workers Subject: Re: bracketed paste mode in xterm and urxvt MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <29061.1433375305.1@thecus.kiddle.eu> Date: Thu, 04 Jun 2015 01:48:25 +0200 Message-ID: <29062.1433375305@thecus.kiddle.eu> Stephane Chazelas wrote: > To sum-up, for a safe bracketed paste, you need either: > > - terminal emulator to filter out ^[ and ^C > ^C is only the default interrupt character. From some basic testing, it seems you can use tcgetattr/tcsetattr on the master side of the pty. So the terminal could perhaps disable isig before writing the string and restore it afterwards. I doubt that an ssh would pass that through, however. > - a different paste mode than xterm's \e[200~\e[201~ which > doesn't work as may contain \e[201~ (something > like: insert-formatted("\033[202~%S~%s", > CLIPBOARD,PRIMARY,CUT_BUFFER0) would do). Would have been better if xterm had done it that way in the first place. As it is, stripping a fake end string should do the job. > - zsh to disable isig. > > Maybe a better approach would be to query the X selection for > instance with xclip/xsel where available. That can also be I've got a widget based on xclip. There isn't always an X connection back, however. It might be worth remembering for when copying text from firefox. The nice thing about getting bracketed paste working is that it potentially doesn't require users to learn anything new: they already know how to paste in their terminal. That's also why I think it is worth trying to include support in a form that doesn't need ohmyzsh plugins or lines in .zshrc. And putting security aside, there are other benefits like the single undo event, newlines not being accepted and the option of manipulating the string such as with shell quoting. Oliver