Comments (2)
It's not possible in termbox. Just because of abstractions used. Termbox doesn't preserve info about lines of text as it's just an array of 2d cells. And I believe similar libs have a similar problem, but maybe I'm wrong about that.
Solution: avoid using terminals. Terminals suck.
from termbox-go.
Sorry for the late answer, but let me get this right:
You want to be able to select a multi-line text but not the entire lines and you don't want the line breaks to be in the selection?
So this is your problem:
If you're still looking for a solution, here's something I hacked together:
Here is the source file in case you're interested: clipboard.go.txt
This basically consists of three things:
- Any mouse press is recorded and added to a selection rectangle.
- The selection rectangle is highlighted in the inverted style.
- When the user presses the enter key, that region is copied to the clipboard.
With this technique, you still cannot intercept C-Ins
(although you can intercept C-S-c
. Also, keep in mind that what I'm doing here is not a real terminal selection but just a highlighted area.
Let me know if this helped you!
from termbox-go.
Related Issues (20)
- device not configured HOT 5
- tmux-256color $TERM unsupported
- panic: The handle is invalid. HOT 1
- Keybindings not working on FreeBSD HOT 2
- Wine panics ("Invalid handle")
- build failure on gnu/hurd HOT 3
- Understanding character codes / sequences HOT 3
- Version tagging HOT 1
- Panic on FreeBSD host HOT 5
- ShowCursor Function
- Save current history/screen in plain text HOT 4
- Why output is ahead of my command rather than after?
- can it support emoji HOT 1
- Chinese characters support issue HOT 1
- KeyEnter and KeyCtrlM map to the same Hex value HOT 1
- Chinese character width occupation problem HOT 3
- how to use with custom pty example ssh
- How do I detect a double-click mouse event?
- Add support for SetOutputMode other than OutputNormal for Windows Terminal
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 termbox-go.