all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Pasting texts into terminal emacs buffer
@ 2020-09-20  5:57 kevin shell
  2020-09-20  6:14 ` Eli Zaretskii
                   ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: kevin shell @ 2020-09-20  5:57 UTC (permalink / raw)
  To: help-gnu-emacs

   Hello emacs users.
   I use gnome-terminal to start emacs with "emacs -nw",
   when I try to paste texts into emacs buffer,
   the echo area outputs "Beginning of buffer", nothing pasting into
   emacs.
   How can I paste texts into emacs?
   (With vim set mouse="" I can paste texts with no problem.)
   --
   kevin


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Pasting texts into terminal emacs buffer
  2020-09-20  5:57 Pasting texts into terminal emacs buffer kevin shell
@ 2020-09-20  6:14 ` Eli Zaretskii
  2020-09-20 12:00   ` Kevin Shell
  2020-09-20 16:38 ` Benjamín Buccianti
  2020-09-24 15:26 ` Jean Louis
  2 siblings, 1 reply; 19+ messages in thread
From: Eli Zaretskii @ 2020-09-20  6:14 UTC (permalink / raw)
  To: help-gnu-emacs

> From: kevin shell <kshell@gmx.com>
> Date: Sun, 20 Sep 2020 07:57:37 +0200
> Sensitivity: Normal
> 
>    Hello emacs users.
>    I use gnome-terminal to start emacs with "emacs -nw",
>    when I try to paste texts into emacs buffer,
>    the echo area outputs "Beginning of buffer", nothing pasting into
>    emacs.
>    How can I paste texts into emacs?

How did you try pasting text into Emacs in this case?  Please describe
what you did in detail.



^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Pasting texts into terminal emacs buffer
  2020-09-20  6:14 ` Eli Zaretskii
@ 2020-09-20 12:00   ` Kevin Shell
  2020-09-20 12:11     ` Eli Zaretskii
  0 siblings, 1 reply; 19+ messages in thread
From: Kevin Shell @ 2020-09-20 12:00 UTC (permalink / raw)
  To: Eli Zaretskii, help-gnu-emacs


Eli Zaretskii 於 2020/9/20 14:14 寫道:
>> From: kevin shell <kshell@gmx.com>
>> Date: Sun, 20 Sep 2020 07:57:37 +0200
>> Sensitivity: Normal
>>
>>     Hello emacs users.
>>     I use gnome-terminal to start emacs with "emacs -nw",
>>     when I try to paste texts into emacs buffer,
>>     the echo area outputs "Beginning of buffer", nothing pasting into
>>     emacs.
>>     How can I paste texts into emacs?
> How did you try pasting text into Emacs in this case?  Please describe
> what you did in detail.


I copy texts with mouse in one terminal tab and switch to another
terminal tab that emacs is running  right click mouse botton 3 and
select Paste,

then the emacs echo area output : Beginning of buffer

No texts are paste into emacs buffer.




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Pasting texts into terminal emacs buffer
  2020-09-20 12:00   ` Kevin Shell
@ 2020-09-20 12:11     ` Eli Zaretskii
  2020-09-20 13:26       ` Kevin Shell
  0 siblings, 1 reply; 19+ messages in thread
From: Eli Zaretskii @ 2020-09-20 12:11 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Kevin Shell <kshell@gmx.com>
> Date: Sun, 20 Sep 2020 20:00:32 +0800
> 
> I copy texts with mouse in one terminal tab and switch to another
> terminal tab that emacs is running  right click mouse botton 3 and
> select Paste,
> 
> then the emacs echo area output : Beginning of buffer
> 
> No texts are paste into emacs buffer.

Does this happen with "emacs -Q"?

And what is the value of your TERM environment variable?



^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Pasting texts into terminal emacs buffer
  2020-09-20 12:11     ` Eli Zaretskii
@ 2020-09-20 13:26       ` Kevin Shell
  2020-09-20 13:54         ` Eli Zaretskii
  0 siblings, 1 reply; 19+ messages in thread
From: Kevin Shell @ 2020-09-20 13:26 UTC (permalink / raw)
  To: Eli Zaretskii, help-gnu-emacs


Eli Zaretskii 於 2020/9/20 20:11 寫道:
>> From: Kevin Shell <kshell@gmx.com>
>> Date: Sun, 20 Sep 2020 20:00:32 +0800
>>
>> I copy texts with mouse in one terminal tab and switch to another
>> terminal tab that emacs is running  right click mouse botton 3 and
>> select Paste,
>>
>> then the emacs echo area output : Beginning of buffer
>>
>> No texts are paste into emacs buffer.
> Does this happen with "emacs -Q"?
>
> And what is the value of your TERM environment variable?


Oh, I can paste with "emacs -Q -nw"。

My TERM value is xterm-256color.


Does it mean site config file cause this issue?




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Pasting texts into terminal emacs buffer
  2020-09-20 13:26       ` Kevin Shell
@ 2020-09-20 13:54         ` Eli Zaretskii
  2020-09-20 14:32           ` Kevin Shell
  0 siblings, 1 reply; 19+ messages in thread
From: Eli Zaretskii @ 2020-09-20 13:54 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Kevin Shell <kshell@gmx.com>
> Date: Sun, 20 Sep 2020 21:26:16 +0800
> 
> >> then the emacs echo area output : Beginning of buffer
> >>
> >> No texts are paste into emacs buffer.
> > Does this happen with "emacs -Q"?
> >
> > And what is the value of your TERM environment variable?
> 
> Oh, I can paste with "emacs -Q -nw"。
> 
> My TERM value is xterm-256color.

Emacs should support pasting with this value of TERM.

> Does it mean site config file cause this issue?

Either the site config, or one of your customizations, yes.



^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Pasting texts into terminal emacs buffer
  2020-09-20 13:54         ` Eli Zaretskii
@ 2020-09-20 14:32           ` Kevin Shell
  2020-09-20 14:37             ` Eli Zaretskii
  2020-09-20 18:14             ` Stefan Monnier
  0 siblings, 2 replies; 19+ messages in thread
From: Kevin Shell @ 2020-09-20 14:32 UTC (permalink / raw)
  To: Eli Zaretskii, help-gnu-emacs


Eli Zaretskii 於 2020/9/20 21:54 寫道:
>> From: Kevin Shell <kshell@gmx.com>
>> Date: Sun, 20 Sep 2020 21:26:16 +0800
>>
>>>> then the emacs echo area output : Beginning of buffer
>>>>
>>>> No texts are paste into emacs buffer.
>>> Does this happen with "emacs -Q"?
>>>
>>> And what is the value of your TERM environment variable?
>> Oh, I can paste with "emacs -Q -nw"。
>>
>> My TERM value is xterm-256color.
> Emacs should support pasting with this value of TERM.
>
>> Does it mean site config file cause this issue?(global-set-key (kbd "M-[") 'scroll-down-line)
> Either the site config, or one of your customizations, yes.


Hello again.

I have found the issue.

The problem is my config line:

  (global-set-key (kbd "M-[") 'scroll-down-line)

but I don't understand why it relates to texts pasting?




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Pasting texts into terminal emacs buffer
  2020-09-20 14:32           ` Kevin Shell
@ 2020-09-20 14:37             ` Eli Zaretskii
  2020-09-20 14:56               ` Kevin Shell
  2020-09-20 18:14             ` Stefan Monnier
  1 sibling, 1 reply; 19+ messages in thread
From: Eli Zaretskii @ 2020-09-20 14:37 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Kevin Shell <kshell@gmx.com>
> Date: Sun, 20 Sep 2020 22:32:59 +0800
> 
> >> Does it mean site config file cause this issue?(global-set-key (kbd "M-[") 'scroll-down-line)
> > Either the site config, or one of your customizations, yes.
> 
> 
> Hello again.
> 
> I have found the issue.
> 
> The problem is my config line:
> 
>   (global-set-key (kbd "M-[") 'scroll-down-line)
> 
> but I don't understand why it relates to texts pasting?

Pasting text on a text-mode terminal sends escape sequences to the
terminal, which are interpreted by the terminal emulator.  Your
binding "steals" the beginning of the escape sequence (recall that the
ESC key acts as the Meta modifier on a TTY), so the paste command is
not seen by the emulator.



^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Pasting texts into terminal emacs buffer
  2020-09-20 14:37             ` Eli Zaretskii
@ 2020-09-20 14:56               ` Kevin Shell
  2020-09-20 15:49                 ` Eli Zaretskii
  0 siblings, 1 reply; 19+ messages in thread
From: Kevin Shell @ 2020-09-20 14:56 UTC (permalink / raw)
  To: Eli Zaretskii, help-gnu-emacs


Eli Zaretskii 於 2020/9/20 22:37 寫道:
>> From: Kevin Shell <kshell@gmx.com>
>> Date: Sun, 20 Sep 2020 22:32:59 +0800
>>
>>>> Does it mean site config file cause this issue?(global-set-key (kbd "M-[") 'scroll-down-line)
>>> Either the site config, or one of your customizations, yes.
>>
>> Hello again.
>>
>> I have found the issue.
>>
>> The problem is my config line:
>>
>>    (global-set-key (kbd "M-[") 'scroll-down-line)
>>
>> but I don't understand why it relates to texts pasting?
> Pasting text on a text-mode terminal sends escape sequences to the
> terminal, which are interpreted by the terminal emulator.
What escape sequuences are sent?
> Your
> binding "steals" the beginning of the escape sequence (recall that the
> ESC key acts as the Meta modifier on a TTY), so the paste command is
> not seen by the emulator.

I have changed binding now。Pasting is now working.

I'm so unlucky。😥





^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Pasting texts into terminal emacs buffer
  2020-09-20 14:56               ` Kevin Shell
@ 2020-09-20 15:49                 ` Eli Zaretskii
  2020-09-22 10:00                   ` Kevin Shell
  0 siblings, 1 reply; 19+ messages in thread
From: Eli Zaretskii @ 2020-09-20 15:49 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Kevin Shell <kshell@gmx.com>
> Date: Sun, 20 Sep 2020 22:56:45 +0800
> 
> > Pasting text on a text-mode terminal sends escape sequences to the
> > terminal, which are interpreted by the terminal emulator.
> What escape sequuences are sent?

According to xterm.el, "ESC [ 200 ~", followed by the text.



^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Pasting texts into terminal emacs buffer
  2020-09-20  5:57 Pasting texts into terminal emacs buffer kevin shell
  2020-09-20  6:14 ` Eli Zaretskii
@ 2020-09-20 16:38 ` Benjamín Buccianti
  2020-09-21 15:00   ` Leo Butler
  2020-09-24 15:26 ` Jean Louis
  2 siblings, 1 reply; 19+ messages in thread
From: Benjamín Buccianti @ 2020-09-20 16:38 UTC (permalink / raw)
  To: help-gnu-emacs

kevin shell <kshell@gmx.com> writes:

>    Hello emacs users.
>    I use gnome-terminal to start emacs with "emacs -nw",
>    when I try to paste texts into emacs buffer,
>    the echo area outputs "Beginning of buffer", nothing pasting into
>    emacs.
>    How can I paste texts into emacs?

Are you pressing Ctrl-v ?

I think the correct keybinding would be Ctrl-y (from yank).

Hope it helps!




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Pasting texts into terminal emacs buffer
  2020-09-20 14:32           ` Kevin Shell
  2020-09-20 14:37             ` Eli Zaretskii
@ 2020-09-20 18:14             ` Stefan Monnier
  1 sibling, 0 replies; 19+ messages in thread
From: Stefan Monnier @ 2020-09-20 18:14 UTC (permalink / raw)
  To: help-gnu-emacs

>  (global-set-key (kbd "M-[") 'scroll-down-line)

`M-[` is also known as the sequence of two bytes `ESC [`.

Many (probably most?) terminal escape sequences begin with this
sequence, so you're in for a lot of disappointment with this binding.
Pasting is just the tip of the iceberg.


        Stefan




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Pasting texts into terminal emacs buffer
  2020-09-20 16:38 ` Benjamín Buccianti
@ 2020-09-21 15:00   ` Leo Butler
  2020-09-21 18:38     ` Colin Baxter
  0 siblings, 1 reply; 19+ messages in thread
From: Leo Butler @ 2020-09-21 15:00 UTC (permalink / raw)
  To: Benjamín Buccianti; +Cc: help-gnu-emacs

Benjamín Buccianti <benjamin@buccianti.dev> writes:

> ********************************************************
> Caution: This message was sent from outside the University of Manitoba.
> ********************************************************
>
> kevin shell <kshell@gmx.com> writes:
>
>>    Hello emacs users.
>>    I use gnome-terminal to start emacs with "emacs -nw",
>>    when I try to paste texts into emacs buffer,
>>    the echo area outputs "Beginning of buffer", nothing pasting into
>>    emacs.
>>    How can I paste texts into emacs?
>
> Are you pressing Ctrl-v ?
>
> I think the correct keybinding would be Ctrl-y (from yank).
>
> Hope it helps!

The OP is using emacs inside gnome-terminal. I would recommend using
emacs to run your shell sessions in, and dispense with gnome-terminal.

M-x shell

or

M-x term

Leo



^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Pasting texts into terminal emacs buffer
  2020-09-21 15:00   ` Leo Butler
@ 2020-09-21 18:38     ` Colin Baxter
  2020-09-21 23:26       ` Emanuel Berg via Users list for the GNU Emacs text editor
  0 siblings, 1 reply; 19+ messages in thread
From: Colin Baxter @ 2020-09-21 18:38 UTC (permalink / raw)
  To: help-gnu-emacs

>>>>> Leo Butler <leo.butler@umanitoba.ca> writes:

    > Benjamín Buccianti <benjamin@buccianti.dev> writes:
    >> ******************************************************** Caution:
    >> This message was sent from outside the University of Manitoba.
    >> ********************************************************
    >> 
    >> kevin shell <kshell@gmx.com> writes:
    >> 
    >>> Hello emacs users.  I use gnome-terminal to start emacs with
    >>> "emacs -nw", when I try to paste texts into emacs buffer, the
    >>> echo area outputs "Beginning of buffer", nothing pasting into
    >>> emacs.  How can I paste texts into emacs?
    >> 
    >> Are you pressing Ctrl-v ?
    >> 
    >> I think the correct keybinding would be Ctrl-y (from yank).
    >> 
    >> Hope it helps!

    > The OP is using emacs inside gnome-terminal. I would recommend
    > using emacs to run your shell sessions in, and dispense with
    > gnome-terminal.

    > M-x shell

    > or

    > M-x term

There has to be something amiss in the OP's setup. I use emacs in a
terminal (xterm) all the time and experience no "copy/paste" issues. One
thing I had to do though was to fix the 'Alt' key by putting
`XTerm*metaSendsEscape: true' in my ~/.Xdefaults

Best wishes,

Colin Baxter.




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Pasting texts into terminal emacs buffer
  2020-09-21 18:38     ` Colin Baxter
@ 2020-09-21 23:26       ` Emanuel Berg via Users list for the GNU Emacs text editor
  2020-09-22  6:21         ` Colin Baxter
  0 siblings, 1 reply; 19+ messages in thread
From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2020-09-21 23:26 UTC (permalink / raw)
  To: help-gnu-emacs

Colin Baxter wrote:

> There has to be something amiss in the OP's setup.
> I use emacs in a terminal (xterm) all the time and
> experience no "copy/paste" issues. One thing I had
> to do though was to fix the 'Alt' key by putting
> `XTerm*metaSendsEscape: true' in my ~/.Xdefaults

Right, I also have that! [1]

  xterm*metaSendsEscape: true

But I don't remember why I set that, I never copy and
paste in xterm so it must be some other reason to do
it as well.


[1] https://dataswamp.org/~incal/conf/.Xresources

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Pasting texts into terminal emacs buffer
  2020-09-21 23:26       ` Emanuel Berg via Users list for the GNU Emacs text editor
@ 2020-09-22  6:21         ` Colin Baxter
  2020-09-22  6:55           ` Emanuel Berg via Users list for the GNU Emacs text editor
  0 siblings, 1 reply; 19+ messages in thread
From: Colin Baxter @ 2020-09-22  6:21 UTC (permalink / raw)
  To: help-gnu-emacs

>>>>> Emanuel Berg via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org> writes:

    > Colin Baxter wrote:
    >> There has to be something amiss in the OP's setup.  I use emacs
    >> in a terminal (xterm) all the time and experience no "copy/paste"
    >> issues. One thing I had to do though was to fix the 'Alt' key by
    >> putting `XTerm*metaSendsEscape: true' in my ~/.Xdefaults

    > Right, I also have that! [1]

    >   xterm*metaSendsEscape: true

    > But I don't remember why I set that, I never copy and paste in
    > xterm so it must be some other reason to do it as well.

Yes, I think that's correct. And I too can't remember now the reasons for
the setting.

Best wishes,




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Pasting texts into terminal emacs buffer
  2020-09-22  6:21         ` Colin Baxter
@ 2020-09-22  6:55           ` Emanuel Berg via Users list for the GNU Emacs text editor
  0 siblings, 0 replies; 19+ messages in thread
From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2020-09-22  6:55 UTC (permalink / raw)
  To: help-gnu-emacs

Colin Baxter wrote:

> Yes, I think that's correct. And I too can't
> remember now the reasons for the setting.

Without it the Meta key wont work!

You have to use the ESC key!

On old keyboards, ESC was located where the CAPS key
is today. So it wasn't as distant.

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal




^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Pasting texts into terminal emacs buffer
  2020-09-20 15:49                 ` Eli Zaretskii
@ 2020-09-22 10:00                   ` Kevin Shell
  0 siblings, 0 replies; 19+ messages in thread
From: Kevin Shell @ 2020-09-22 10:00 UTC (permalink / raw)
  To: help-gnu-emacs, Eli Zaretskii

On Sun, Sep 20, 2020 at 06:49:17PM +0300, Eli Zaretskii wrote:
> > From: Kevin Shell <kshell@gmx.com>
> > Date: Sun, 20 Sep 2020 22:56:45 +0800
> >
> > > Pasting text on a text-mode terminal sends escape sequences to the
> > > terminal, which are interpreted by the terminal emulator.
> > What escape sequuences are sent?
>
> According to xterm.el, "ESC [ 200 ~", followed by the text.
>

The issue is concern with my config and already fixed.
Thank you all.

--
kevin



^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Pasting texts into terminal emacs buffer
  2020-09-20  5:57 Pasting texts into terminal emacs buffer kevin shell
  2020-09-20  6:14 ` Eli Zaretskii
  2020-09-20 16:38 ` Benjamín Buccianti
@ 2020-09-24 15:26 ` Jean Louis
  2 siblings, 0 replies; 19+ messages in thread
From: Jean Louis @ 2020-09-24 15:26 UTC (permalink / raw)
  To: kevin shell; +Cc: help-gnu-emacs

* kevin shell <kshell@gmx.com> [2020-09-20 08:59]:
>    Hello emacs users.
>    I use gnome-terminal to start emacs with "emacs -nw",
>    when I try to paste texts into emacs buffer,
>    the echo area outputs "Beginning of buffer", nothing pasting into
>    emacs.
>    How can I paste texts into emacs?
>    (With vim set mouse="" I can paste texts with no problem.)

You may paste the clipboard buffer into terminal by using Shift-Ins

Jean



^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2020-09-24 15:26 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-20  5:57 Pasting texts into terminal emacs buffer kevin shell
2020-09-20  6:14 ` Eli Zaretskii
2020-09-20 12:00   ` Kevin Shell
2020-09-20 12:11     ` Eli Zaretskii
2020-09-20 13:26       ` Kevin Shell
2020-09-20 13:54         ` Eli Zaretskii
2020-09-20 14:32           ` Kevin Shell
2020-09-20 14:37             ` Eli Zaretskii
2020-09-20 14:56               ` Kevin Shell
2020-09-20 15:49                 ` Eli Zaretskii
2020-09-22 10:00                   ` Kevin Shell
2020-09-20 18:14             ` Stefan Monnier
2020-09-20 16:38 ` Benjamín Buccianti
2020-09-21 15:00   ` Leo Butler
2020-09-21 18:38     ` Colin Baxter
2020-09-21 23:26       ` Emanuel Berg via Users list for the GNU Emacs text editor
2020-09-22  6:21         ` Colin Baxter
2020-09-22  6:55           ` Emanuel Berg via Users list for the GNU Emacs text editor
2020-09-24 15:26 ` Jean Louis

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.