Comments (17)
Thanks (referenced commit is fec3892). FWIW, issuing printf '\033[?2004l'
can help one to disable bracketed paste mode if their terminal ended up in it for whatever reason.
from clifm.
Yup, commit 2262496 no longer exhibits the problem for me, thanks!
from clifm.
Hi @danfe! Thanks for reporting. Those are bracketed paste escape codes, so I'm pretty sure (though I've haven't reproduced the issue) that the thing is related to readline's config. Try this:
Edit readline's config file (~/.config/clifm/readline.clifm
) and disable enable-bracketed-paste
as follows:
set enable-bracketed-paste off
Or just comment out the line.
Restart clifm.
from clifm.
set enable-bracketed-paste off
This worked, thanks, nice and quick fix, albeit well-behaved programs should not leave the terminal in a troubled state regardless of the settings. :-)
Or just comment out the line.
This didn't work for some reason (tried it first).
from clifm.
Great! To be honest, I don't remember why this setting was set to on by default (indeed, the comment above -I mean, in the config file, clearly says "disable").
from clifm.
With the latest commit, bracketed-paste is disabled by default.
from clifm.
well-behaved programs should not leave the terminal in a troubled state regardless of the settings
@danfe, you're right of course. Could you please give the following a try?
- Compile/run the latest version of clifm.
- Reenable bracketed-paste.
- Make sure the issue is gone.
The latest commit makes clifm reset the terminal to its previous state immediately before quitting.
from clifm.
Make sure the issue is gone.
Hmm, it's not gone, I still need to reset the terminal by hand.
from clifm.
Ok. I'm using tcsetattr(3) to reset the terminal to its original state, saved at startup. This works fine and gives us a more consistent behavior. I guess thereby that this bracketed paste thing is a readline-specific feature/issue (maybe some readline internal function might work, but I'm not sure).
Of course, I can always print \033[?2004l
at exit -as you suggested- to disable the feature (as far as I know this is what the nano
editor does). But, to make this the right way I should find out first whether the running terminal supports it, and secondly, print it only if the feature was actually enabled.
I'll keep this in mind. For the time being, keeping the thing off by default is quite safe.
from clifm.
For the time being, keeping the thing off by default is quite safe.
Fair enough, I agree.
from clifm.
Be it as it may, I still need to reproduce the issue. Could you please report the exact steps you take? How are you pasting to the terminal from the clipboard?
Running FreeBSD/amd64 14.0, Clifm 1.16.1 (tried also 1.14.6), on XTerm 385.
Personally, I'm using this on my .Xresources
:
XTerm*VT100.Translations: #override \
Ctrl Shift <Key>V: insert-selection(CLIPBOARD) \n\
Ctrl Shift <Key>C: copy-selection(CLIPBOARD)
I can copy to the clipboard via Ctrl-C as always (in Leafpad, say) or with Ctrl-Shift-C in XTerm itself, and then Ctrl-Shift-V, either on clifm itself or, after exiting, on XTerm: works fine in both cases.
from clifm.
How are you pasting to the terminal from the clipboard?
I select the text with LMB, it goes to X11 primary selection buffer (others are: clipboard, secondary, buffer-cut). In the example below, I double-click on the word "true":
$ true
$ xclip -selection primary -o
true$ _
The above xclip(1) command yields the same result as clicking the MMB or pressing Shift-Insert. Now, if I run and exit CliFM:
$ true
$ xclip -selection primary -o
true$ hd
^[[200~true^[[201~
00000000 1b 5b 32 30 30 7e 74 72 75 65 1b 5b 32 30 31 7e
Interestingly, xclip(1) returns undecorated string, but not when pasting with keyboard or mouse. That being said, I do have a bunch of non-standard XTerm-related settings in my ~/.Xdefaults
, I'll redo the tests in clean environment.
from clifm.
Reproduced! It depends on how you exit clifm though: it happens when you exit with Ctrl-D or F12, but not with the q/quit/exit
command. Briefly put, the issue is triggered when you exit via a keybinding.
from clifm.
it happens when you exit with
Ctrl-D
orF12
, but not with theq/quit/exit
command.
Confirmed (I always exit with ^D
from everywhere so long it's supported).
from clifm.
We're on the right track, very close! Give me a few minutes.
from clifm.
Done! Give it a try now.
from clifm.
Thanks for your help @danfe! Closing.
from clifm.
Related Issues (20)
- Readline vi-mode remapping compatibility HOT 8
- constant CPU utilization on linux HOT 4
- Spawned apps detaching from Clifm HOT 22
- no directory prediction after .. buf after ... HOT 3
- recursive search for files using /... -x doesn't work on Windows HOT 10
- Missing dependencies HOT 3
- bulk rename HOT 3
- Build failure with -D_NO_ICONS HOT 2
- Default pdf viewer HOT 4
- temporary paging mode HOT 13
- p and pp could show the number of files HOT 80
- Returning to `clifm` prompt after suspending a running job by sending the suspend character (`Ctrl+Z`) HOT 1
- linker erros during the build process on on msys2 HOT 3
- Assign ELNs to the output of commands HOT 3
- 2-step symbolic link creation HOT 10
- Build failure with -D_NO_SUGGESTIONS HOT 1
- files getting deleted by ungood bulk rename HOT 3
- Fastfetch bug HOT 9
- Submit clifm to Debian unstable
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clifm.