Comments (9)
Yeah, this works for me in the tests I’ve thrown at it. It’s merged in now.
There is a trade-off here: if you use it for actual file manipulation (e.g. drag into a file manager), it’s going to copy the symlink and not the file, which isn’t very useful. Dragging to a browser or something is probably the more common use case so I’ve merged it, but I might add a --follow-symlinks
option or something for the other case.
from dragon.
This is the behaviour I would expect, though there's a case for it to be an option. Moving a fixed symlink about isn't terribly useful.
from dragon.
I came across this when I was trying to upload some files. I had the original files scattered around my filesystem, and I had collated them into another directory using symlinks, concurrently giving them appropriate filenames. I dragged the symlinks into my browser, which uploaded the data fine, as expected, but the names were all wrong.
Another usage case where this might be a problem is if you were to embed an image into another file. I often embed a symlinked raster image into, say, Inkscape. If I then need to modify the original file, I just change the symlink to point at the new, modified file. Similarly so when I reference images in LyX/LaTeX.
In general, I can't think of a case where I'd want it deferenced, or if there's any advantage to do so, but perhaps that's just my usage though.
from dragon.
I also would also have expected path names to be left unchanged. Since the interface is CL, users who want the path normalized in some way can easily throw in a realpath
etc. invocation themselves.
from dragon.
Okay, since this may be passed as a URI it must be at least absolute. I’d recon the least surprising way to achieve this would be to prepend the CWD and canonicalize without resolving symlinks.
from dragon.
Fixing #2 also fixes this, since GIO will canonicalize the path, but will leave symlinks untouched.
from dragon.
@eigengrau Your commit partially works. I can click on b
, and now dragon leaves the symlink untouched, which is great. However, when I try to drag b
, dragon still outputs a
instead.
from dragon.
@protist I cannot reproduce this yet. Did you accidentally run your globally installed build of dragon
instead of the binary built from git, by any chance?
When I run this (from 7716c30):
touch a
ln -s a b
./dragon --verbose a b
Dragging b
into a dragon --target
will print:
Writing as URI: file:///home/seb/dev/c/dragon/b
And the --target
instance also receives this URL.
from dragon.
Oops, apologies. I was testing by dragging into a program that automatically dereferenced the symlink. I can confirm that your code works perfectly! Thank you!
from dragon.
Related Issues (20)
- is_uri is too lax, e.g. timestamps are false positives HOT 1
- Dragon can't handle combined flags HOT 1
- [FEATURE REQUEST] Add --sticky flag HOT 1
- Mention Arch Linux package in readme HOT 4
- Add a option to help with --and-exit HOT 2
- Rudimentary homebrew formula
- only drag files, do not open window HOT 4
- --on-top does not work in Plasma on wayland
- [FR] Add -- option to prevent interpretation of filenames with dashes HOT 2
- [SUGGESTION] Dragging plaintext only
- [FEATURE REQUEST] More appearance customization
- Bash auto completions only show directory names HOT 2
- Option to append more files HOT 4
- Option to remove file from list
- Option to auto-refresh file list
- [QoL]: close on click
- Improvements - imho
- --and-exit does not work on Sway/Wayland
- Multi-select in open window to drag out HOT 6
- Dragon doesnt work on Sway
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 dragon.