Comments (10)
-
Shouldn't
gsettings get org.cinnamon.desktop.default-applications.terminal exec-arg
be set to-e
. But even then I'm not sure this will work as expected because of howtym
expects args for the-e
flag. I have a hacky partial fix implemented here that you can test. -
Make sure you have the latest version and the latest daemon is running to open terminals in the current folder.
from tym.
Sorry for late reply.
As you note, tym can not handle the options correctly. In this case, I think it is appropreate to use double dash option ( --
).
For example in lxc,
$ lxc exec <container name> ls -l /usr
This won't work but
$ lxc exec <container name> -- ls -l /usr
This works. The options after --
is ignored by lxc
command and they are processed together. As a UNIX command, this treatment traditionally exists. I guess the DE (cinnamon) also expects the treatment implicitly.
To implement this, I need some time to find the correct behavior as a normal terminal but I will do in due time. Please wait.
from tym.
@js-everts Thank you for the reply! Problems basically solved.
- I did notice the
-e
flag, and also the fact that the shell command need quoting. As tested, the flag change doesn't work. But your fix branch works! - Indeed it's because I haven't restarted the daemon since v3.4.1 update, this version works well now.
from tym.
For what its worth you can find my (half baked) take on this here. It basically follows your idea of using --
followed by commands:
$ tym -- less Dockerfile
While all this works (both in --isolated and --daemon). Lua can no longer set the command ('shell'). Since all the lua config fields and command line options come from the same table and since I have removed the '--shell' flag from that table, Lua no longer has knowledge about it. I'm not sure how to go about this (maybe special case 'commands'?).
Anyway, I think we would want something like this in lua word:
tym.set('command', {'prog', 'arg1', 'arg2'})
tym.setconfig({
'command', {'prog', 'arg1', 'arg2'},
})
// or maybe even
tym.set_command({'prog', 'arg1', 'arg2'})
from tym.
Just for completeness, I should mention my fix won't work if you try to open a file with spaces in it.
from tym.
I noticed. I looked into your fix's code, and saw the comment It would be much better if can store these as an array
. That will indeed solve that issue.
from tym.
I changed the issue title, since this is the main problem here. Feel free to improve it to better describe the issue.
Basically, tym could fit into more scenarios (including some gui file managers) if it accepts shell command options as some other programs, like st, alacritty or foot, do:
- Accepts all remaining arguments, those tym does not accept, as shell command, i.e.
tym [tym options] command [command args]
- For compatibility, accept a
-e
option, i.e.
tym [tym options] -e command [command args]
This effectively makes-e
the last option since anything after it is treated as shell command.
from tym.
The spec "Only when -e
is provided, the following options are parsed differently" is a kind of the workarounds, I think.
I feel that this kind of issues are equally problematic in other projects and that the general consensus is to use --
.
from tym.
I think, which solution to choose really depends on the way of how other popular programs spawn terminal emulators. For example, tym has to work with most file managers on opening terminal in current directory and open text files with vim in a terminal, etc. So, to know whether they support --
maybe require some research.
from tym.
@endaaman Thanks for the latest release, I noticed tym now supports --
followed by the shell command. I found out I can also do tym nvim text.txt
without --
. Not sure if that's the intended behavior.
For anyone with similar issues, here are my research and solutions after this update:
There are different scenarios of "opening in terminal":
-
Those with explicit configurations, e.g., i3, xfce(thunar), nemo. In those cases, you can configure with their configuration files, GUI settings app (xfce), or gsettings (nemo).
These are actually less problematic, since they are configurable. The real problem is the 2nd case.
-
Desktop entry with
Terminal=true
. Such as right click in nemo and choose "Open in Vim". This behavior is not controlled by nemo, but by how the desktop entryvim.desktop
is executed. I finally found out, in this case, it's up to Gio to decide the terminal emulator, unfortunately in a hard-coded way, see the code here. So the hack is to "disguise" tym as gnome-terminal, which accept--
as well:ln -sf /bin/tym ~/.local/bin/gnome-terminal
Alternatively, one can implement a
xdg-terminal-exec
command to spawn tym:cat > .local/bin/xdg-terminal-exec << EOF #!/bin/sh tym -- "\$@" EOF chmod +x .local/bin/xdg-terminal-exec
from tym.
Related Issues (20)
- viu support HOT 4
- Api function to reload all tym instances HOT 1
- Add Wayland Support HOT 4
- specific padding for parts of terminal HOT 2
- I can't load my theme file with --theme HOT 2
- It appears that tym.get_config_path() does not work when I state --use explicitly HOT 4
- Border around tym window HOT 3
- setting theme from main config not working right
- Terminal Image Protocol HOT 3
- Doesn't respect CFLAGS HOT 2
- Background image option not working as expected HOT 2
- Support ligatures HOT 1
- would a universal package or precompiled "universal"(per architecture) binary be possible
- deb/rpm packages
- there are some misspellings in the README HOT 1
- Possible for daemon to start without GUI? HOT 7
- Migrate CI to GitHub actions. HOT 1
- request: allow for using a custom handler/opener, or xdg-open as an alternative to the current way(which opens the wrong browser for me) HOT 8
- Fonts not working HOT 3
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 tym.