Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ctrl-v to paste not working #2184

Closed
drewauff opened this issue Aug 13, 2021 · 34 comments
Closed

Ctrl-v to paste not working #2184

drewauff opened this issue Aug 13, 2021 · 34 comments

Comments

@drewauff
Copy link

drewauff commented Aug 13, 2021

@jsyedidia ctrl-v to paste is not working in latest version..however cutting a line (ctrl-k) then undoing that cut, make its work again, this is a bug, it is repeatable/reproducable.

After a lot more testing, seems ctrl-x and ctrl-k work just fine and I can still paste with ctrl-v, but ctrl-c is dead.

I should mention that whan pasting (ctrl-v) micro still displays the message at the bottom " Pasted clipboard" but does NOT actually paste anything.

its really quite strange even after doing a ctrl-c, ctrl-v only pastes what was previously cut with ctrl-x or ctrl-k and not what I copied with ctrl-c

Commit hash: b976385
OS: MacOS Catalina
Terminal: iTerm2 latest beta
Micro Version: 2.0.10

@zyedidia
Copy link
Owner

I’m not able to reproduce this issue. What is the value of the clipboard option? (> show clipboard)

@drewauff
Copy link
Author

drewauff commented Aug 14, 2021

internal

Should have mentioned before, ctrl-v pastes what I was copied with CMD-C unless I cut with ctrl-x or ctrl-k.

I tested with iTerm2, Kitty, Terminal and Alacritty..problem persists in all. So I know its not the terminal.

In nano if I copy then try to paste I get an error message "cut buffer empty" I but if cut, it pastes normally.

@da2x
Copy link

da2x commented Aug 14, 2021

I’m having a similar issue with the Windows Terminal with Ubuntu 20.04 and Micro 2.0.8. Ctrl+k cuts the line, and Ctrl+V pastes whatever is in the Windows clipboard. It works fine if I first empty the Windows clipboard. Very occasionally, it works even when there’s something on the Windows clipboard. The Windows clipboard history never picks up on what I copy in Micro.

@zyedidia
Copy link
Owner

This is likely because clipboard is set to internal. When using an internal clipboard, micro makes no attempt to read the system clipboard. Perhaps ctrl-v is reading the system clipboard via your terminal rather than sending micro the event.

The solution on macOS is to set clipboard to external.

On WSL things are more complicated, because the usual solution on Linux is to install and use xclip, but WSL has no X server. I think some people have used a workaround using a script called xclip that invokes a tool called clip.exe but I am not familiar with it.

@drewauff
Copy link
Author

I had a system upgrade come though, did that and it seems to have done the trick, at least for now. Thanks you all your help.

While I have you here, I downloaded a plugin, cloned to the appropriate dir, but micro does not recognise it. How do I get micro to recognise the plugin.

@zyedidia
Copy link
Owner

Micro should automatically recognize it if you cloned it to ~/.config/micro/plug. Could you show the tree directory structure you have in your micro config?

@drewauff
Copy link
Author

drewauff commented Aug 16, 2021

my short settings.conf
{ "clipboard": "external", "colorscheme": "atom-dark", "initlua": true, "pluginchannels": [ "https://raw.githubusercontent.com/micro-editor/plugin-channel/master/channel.json" ], "pluginrepos": [], "splitBottom": true, "splitRight": true, "test": true }

Am I supposed to declare my "plug" path in the settings.conf ?

This is the plugin micro-fzf

Just adds "shortcuts" to hsplit and "vsplit"

would be nice to be able to hit a shortcut key, then be prompted for file name (searchable via fzf) hit enter and opens in split.

Regarding split mode, is it possible to change the color/thickness of the split line?

@drewauff
Copy link
Author

UPDATE!!: I change the plugins dir from "micro-fzf" to "microfzf" and it now works perfectly!

Would still, however prefer a keybind.. can I add custom binds to the bindings.json?

@lslvr
Copy link

lslvr commented Sep 14, 2021

@drewauff,

"Regarding split mode, is it possible to change the color/thickness of the split line?"

Yes. You might want to see the divchars and divreverse options. The first one sets the characters used to draw horizontal and vertical splits. The second one determines whether micro changes the background color of those characters. I use the following: "divchars": "│─", and "divreverse": false.

If your issue got resolved, could you please close the issue?

@drewauff
Copy link
Author

divchars works, but cant get a smooth line with hsplit..and there is a small gap between the vertical and horizontal lines.

@lslvr
Copy link

lslvr commented Sep 15, 2021

That's probably because of how your terminal renders the characters. Which terminal do you use? I use xterm with this line ─*forceBoxChars: true─ in my .Xresources.

Also, make sure you're using and not |, and instead of - (They might look almost the same in your browser, but they aren't).

@drewauff
Copy link
Author

I use iTerm..

@lslvr
Copy link

lslvr commented Sep 15, 2021

Could you try changing your font?

@drewauff
Copy link
Author

Currently using Hack Nerd Mono, changing doesnt work

@lslvr
Copy link

lslvr commented Sep 15, 2021

That's sad. Perhaps there's some configuration similar to xterm's forceBoxChars? I can't help any further. Sorry.

@drewauff
Copy link
Author

oh the vertical split line works but the horizontal line overlaps itself..hmm

@drewauff
Copy link
Author

ok its fixed!, turns out it was a setting I missed in the advanced section.

Now that thats working, its bright white how can I darken it? maybe even use a custom value (hex)?

@lslvr
Copy link

lslvr commented Sep 15, 2021

I'm glad you finally got it solved. I use a theme I made myself, that's how you can tweak the colors (but, did you try setting the divreverse setting to off?). In a new theme (drop it in ~/.config/micro/colorschemes/), this line is the one that controls the divider's colors: color-link divider "<color>".

For further details see https://github.com/zyedidia/micro/blob/master/runtime/help/colors.md.

@drewauff
Copy link
Author

yeah I tried divreverse all it did was make the background inverted..

Ok, Ill have a look.

@lslvr
Copy link

lslvr commented Sep 15, 2021

Exactly. Set it to off to inherit your terminal's background color.

@drewauff
Copy link
Author

oh, it was the split line I wanted to change not the background...

@lslvr
Copy link

lslvr commented Sep 15, 2021

Yes. set divreverse off will make those lines (which are characters) inherit the terminal's background color (I think that's what you meant when you wrote "thickness of the split line").

@drewauff
Copy link
Author

yes, but it also inverts the background of the split line ie black line on white background. I want to make the split line gray..

@lslvr
Copy link

lslvr commented Sep 16, 2021

Okay, just set divreverse off and, in a custom theme, color-link divider "8". That's it.

@drewauff
Copy link
Author

drewauff commented Sep 16, 2021

Works, Thank You!!

Only thing is the split lines dont go the full width/height..a bit odd but thought Id let you know

@lslvr
Copy link

lslvr commented Sep 16, 2021

Great!

As I mentioned earlier, that's most surely an issue with how your terminal renders the characters. If you could tweak the line height you might get rid of it.

@lslvr
Copy link

lslvr commented Sep 18, 2021

@drewauff please close this issue.

@drewauff
Copy link
Author

Ok will do, just a quick question, I posted this https://github.com/zyedidia/micro/issues/2207#issuecomment-918746173

I would dearly love to get this working..to be able to access recently opened files in the split of your choice etc. would prove, I think, to be invaluable.

Thank you for the help you have provided. I appreciate you and your time. Thank You.

@lslvr
Copy link

lslvr commented Sep 22, 2021

You're welcome. 😀

@espdev
Copy link

espdev commented Nov 6, 2021

@da2x I had the same issue with clipboard in WSL inside Windows Terminal. I'm currently using the following workaround: https://github.com/Konfekt/xclip-xsel-WSL

It works great.

@drewauff drewauff closed this as completed Nov 6, 2021
@sdancer75
Copy link

@da2x I had the same issue with clipboard in WSL inside Windows Terminal. I'm currently using the following workaround: https://github.com/Konfekt/xclip-xsel-WSL

It works great.

It didn't work for me. After script installation, my bash .profile looks like this. Where am I wrong to my settings?

# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.

# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022

#export DISPLAY="$(grep -m 1 nameserver /etc/resolv.conf | awk '{print $2}'):0.0"
#export CHOKIDAR_USEPOLLING=true

# if running bash
if [ -n "$BASH_VERSION" ]; then
    # include .bashrc if it exists
    if [ -f "$HOME/.bashrc" ]; then
        . "$HOME/.bashrc"
    fi
fi

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/.local/bin" ] ; then
    PATH="$HOME/.local/bin:$PATH"
fi

[ -z ${WSLENV+x} ] || export PATH="${PATH:+"$PATH:"}$HOME/bin/win-bash-xclip-xsel"

@espdev
Copy link

espdev commented Nov 2, 2022

@sdancer75

I just use the following symlinks:

$ cd ~/bin 
$ ls -lh
total 17M
-rwxr-xr-x 1 espdev espdev  760 Nov  6  2021 clip.sh
-rwxr-xr-x 1 espdev espdev  12M Aug  7  2021 micro
-rwxr-xr-x 1 espdev espdev 5.2M Jun 17 15:13 scc
lrwxrwxrwx 1 espdev espdev    7 Nov  6  2021 xclip -> clip.sh
lrwxrwxrwx 1 espdev espdev    7 Nov  6  2021 xsel -> clip.sh

~/bin was added to PATH. And that is it. It works fine.

@sdancer75
Copy link

sdancer75 commented Nov 3, 2022

@sdancer75

I just use the following symlinks:

$ cd ~/bin 
$ ls -lh
total 17M
-rwxr-xr-x 1 espdev espdev  760 Nov  6  2021 clip.sh
-rwxr-xr-x 1 espdev espdev  12M Aug  7  2021 micro
-rwxr-xr-x 1 espdev espdev 5.2M Jun 17 15:13 scc
lrwxrwxrwx 1 espdev espdev    7 Nov  6  2021 xclip -> clip.sh
lrwxrwxrwx 1 espdev espdev    7 Nov  6  2021 xsel -> clip.sh

~/bin was added to PATH. And that is it. It works fine.

Hi, thanks, I just changed the order of the line path and now it works. I am on also with WSL2.

Regards,

# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.

# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022

#export DISPLAY="$(grep -m 1 nameserver /etc/resolv.conf | awk '{print $2}'):0.0"
#export CHOKIDAR_USEPOLLING=true

export PATH="$HOME/bin/win-bash-xclip-xsel:$PATH"

# if running bash
if [ -n "$BASH_VERSION" ]; then
    # include .bashrc if it exists
    if [ -f "$HOME/.bashrc" ]; then
	. "$HOME/.bashrc"
    fi
fi

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/.local/bin" ] ; then
    PATH="$HOME/.local/bin:$PATH"
fi

@skyline570
Copy link

@jsyedidia ctrl-v to paste is not working in latest version..however cutting a line (ctrl-k) then undoing that cut, make its work again, this is a bug, it is repeatable/reproducable.

After a lot more testing, seems ctrl-x and ctrl-k work just fine and I can still paste with ctrl-v, but ctrl-c is dead.

I should mention that whan pasting (ctrl-v) micro still displays the message at the bottom " Pasted clipboard" but does NOT actually paste anything.

its really quite strange even after doing a ctrl-c, ctrl-v only pastes what was previously cut with ctrl-x or ctrl-k and not what I copied with ctrl-c

Commit hash: b976385 OS: MacOS Catalina Terminal: iTerm2 latest beta Micro Version: 2.0.10

I tried right clicking in the terminal and it pastes your copied text into it when you right click on that space. see if it works for you as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants