Results 1 to 10 of 10

Thread: Easiest way to cut and paste from terminal to X?

  1. #1
    Join Date
    Aug 2005
    Beans
    465

    Easiest way to cut and paste from terminal to X?

    I want to cut and paste from terminal/emacs to X applications.

    What's the easiest method? i've had a look online and nothing works for me.
    I wish my computer would do what I want it to do - not what I tell it to do.

  2. #2
    Join Date
    Oct 2005
    Location
    Lab, Slovakia
    Beans
    10,791

    Re: Easiest way to cut and paste from terminal to X?

    Highlight and middle click?

  3. #3
    Join Date
    Aug 2017
    Location
    melbourne, au
    Beans
    Hidden!
    Distro
    Lubuntu Development Release

    Re: Easiest way to cut and paste from terminal to X?

    I'd highlight & right-click (which offers a menu, and reminder of what keyboard shortcuts exist if you don't want to click)

    Providing specific OS, release, desktop (or WM) & terminal may also help; as Ctrl+INS works on some as well; but not my default terminal/desktop choice.

  4. #4
    Join Date
    Aug 2011
    Location
    52.5° N 6.4° E
    Beans
    6,821
    Distro
    Xubuntu 22.04 Jammy Jellyfish

    Re: Easiest way to cut and paste from terminal to X?

    A terminal is a GUI application (in contrast to the applications running in the terminal). Copying and pasting works in the same way as in any other GUI application, except that the keyboard shortcuts use ctrl+shift+c, ctrl+shift+v, where other applications use ctrl+c, ctrl+v. Select and middle click works best (unless your middle mouse button is broken, as often happens for me).

  5. #5
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Easiest way to cut and paste from terminal to X?

    I use select & paste. It is part of X11 and has been for 35+ yrs. It uses the X-buffer.

    1. Select with the left mouse button - there are single, double, and triple-click techniques.
    2. Paste with the middle mouse button.


    No keyboard needed.
    No menus needed.

    select ... move to the input field, paste.
    This is for text only. For other complex copy/paste operations, use one of the clipboards.

    In 21.04, I've noticed that bash changed their default settings to screw with proper pasting. If I select the EOL, when I paste, I want the command to have an <enter> ... like it has for 35+ yrs. If I select in a way that doesn't include an EOL, then the paste should reflect that as well and not run a command.

    PuTTY from Windows, sorta does the select/paste method, just with the right-click to paste immediately. Or it did last time I used Putty - perhaps 10 yrs ago.

  6. #6
    Join Date
    Aug 2005
    Beans
    465

    Re: Easiest way to cut and paste from terminal to X?

    Code:
    dara@laptop-20-04:~$ uname -a
    Linux laptop-20-04 5.11.0-25-generic #27-Ubuntu SMP Fri Jul 9 23:06:29 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
    Whenever I try to cut and paste from terminal the cut option is greyed out when i right-click with the touchpad. I've tried multiple files and I've done a

    Code:
    sudo emacs -nw myfile.php
    The cut option doesn't appear. Pls see attached screenshot...

    I wish my computer would do what I want it to do - not what I tell it to do.

  7. #7
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Easiest way to cut and paste from terminal to X?

    There's no such thing as cut in a terminal using a mouse. Sorry. Terminals are like paper. Once they are printed, line by line, there's no going back. A terminal window isn't like a full-screen editor. It is only the last line that can be modified. Learn your shell to understand how to do that. Regardless of where you place the mouse and tell it to paste, it will only paste where the cursor is on-the-last-line. That paste could be insert or overwrite - just depends on your shell settings. Typically, people use either emacs or vi keybindings for their shell editor. That only means something if you know those two editors.

    https://github.com/jlevy/the-art-of-command-line shows how to perform command line editing with bash - among other things. Read it once a year, so the things you don't understand today can still be learned next year when your understanding has expanded.

  8. #8
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Easiest way to cut and paste from terminal to X?

    BTW, if you are using emacs, perhaps you want to use Xemacs for cut/paste?

  9. #9
    Join Date
    Aug 2005
    Beans
    465

    Re: Easiest way to cut and paste from terminal to X?

    don't like X. speaking of which.

    i've uninstalled emacs-gtk

    but emacs is still on my desktop GUI. how do i remove all X emacs altogether?
    I wish my computer would do what I want it to do - not what I tell it to do.

  10. #10
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Easiest way to cut and paste from terminal to X?

    Search for "Ubuntu Desktop Guide" or "The Linux Command Line". Both those references answer these sorts of questions.

    There might be a desktop guide for each different GUI, LXQt/LXDE/XFCE/Mate/KDE, but the default on is for Gnome3. I don't use any of those. Sorry. They all work basically the same, I'd assume.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •