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

support paste and undo #51

Merged
merged 2 commits into from
Feb 1, 2019
Merged

support paste and undo #51

merged 2 commits into from
Feb 1, 2019

Conversation

jixiuf
Copy link
Collaborator

@jixiuf jixiuf commented Dec 18, 2018

No description provided.

@akermu
Copy link
Owner

akermu commented Jan 27, 2019

For me undo works correctly if I bind C-_ to vterm-self-insert. And yanking also works.. @jixiuf Could you explain me, what this PR adds on top?

@jixiuf
Copy link
Collaborator Author

jixiuf commented Jan 28, 2019

For me undo works correctly if I bind C-_ to vterm-self-insert. And yanking also works.. @jixiuf Could you explain me, what this PR adds on top?

it only works for bash ,not for zsh .

@jixiuf jixiuf force-pushed the paste-and-undo branch 2 times, most recently from dd952f7 to 124429b Compare January 29, 2019 04:53
@deb0ch
Copy link
Contributor

deb0ch commented Jan 29, 2019

Also, the way yanking is currently implemented is that elisp code sends the characters one by one to the terminal, which is not the most optimised way to go about it

@akermu
Copy link
Owner

akermu commented Jan 29, 2019

@jixiuf But why does C-_ work and C-/ doesn't? In any case I will add your workaround to the master. Thanks!

@akermu
Copy link
Owner

akermu commented Jan 29, 2019

I like to support bracket paste. But to keep the code simple, can we just use the old char by char code and add a special key like "start_paste" and "end_paste". Then we don't need the import from glib.

@jixiuf
Copy link
Collaborator Author

jixiuf commented Jan 30, 2019

I like to support bracket paste. But to keep the code simple, can we just use the old char by char code and add a special key like "start_paste" and "end_paste". Then we don't need the import from glib.

done

vterm.el Outdated
@@ -137,6 +137,7 @@ for different shell. "
(define-key vterm-mode-map (kbd "C-c C-c") #'vterm-send-ctrl-c)
(define-key vterm-mode-map (kbd "C-_") #'vterm--self-insert)
(define-key vterm-mode-map (kbd "C-SPC") #'vterm--self-insert)
(define-key vterm-mode-map (kbd "C-/") #'vterm-undo)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should keep it aligned with the rest

vterm.el Outdated
(interactive)
(vterm-send-key "_" nil nil t))


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra blank line does not match coding style of the file

vterm.el Outdated
@@ -176,16 +177,26 @@ for different shell. "
(interactive)
(vterm-send-key "c" nil nil t))

(defun vterm-undo()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space between function name and parameter list. I thought it wouldn't even work without a space in Elisp ?

@deb0ch
Copy link
Contributor

deb0ch commented Jan 31, 2019

I like to support bracket paste. But to keep the code simple, can we just use the old char by char code and add a special key like "start_paste" and "end_paste". Then we don't need the import from glib.

Does it mean that we will never ever have a fast paste ?

@akermu
Copy link
Owner

akermu commented Feb 1, 2019

I like to support bracket paste. But to keep the code simple, can we just use the old char by char code and add a special key like "start_paste" and "end_paste". Then we don't need the import from glib.

Does it mean that we will never ever have a fast paste ?

Nope, but I want to try the simple approach first and if it's not sufficient, we can optimize it.

@akermu akermu merged commit 52d4520 into akermu:master Feb 1, 2019
@akermu
Copy link
Owner

akermu commented Feb 1, 2019

Thanks again for your efforts @jixiuf !

@jixiuf jixiuf deleted the paste-and-undo branch April 29, 2019 03:24
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

Successfully merging this pull request may close these issues.

None yet

3 participants