Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@sxyazi
Copy link
Owner

@sxyazi sxyazi commented Aug 10, 2023

The new enhanced exec format will be shipped with Yazi v0.1.3, the old format will still be available until v0.1.5.

Mainly affects opener rules, you should be able to switch between them easily:

[opener]
archive = [
	{ cmd = "unar", args = [ "$0" ] },
]
text = [
	{ cmd = "nvim", args = [ "$*" ], block = true },
]
# ...

to

[opener]
archive = [
	{ exec = 'unar "$1"' },
]
text = [
	{ exec = 'nvim "$@"', block = true },
]
# ...

This makes more complex cases possible, such as:

[opener]
video = [
	{
		exec = '''mediainfo "$1"; echo "PRESS ENTER TO EXIT"; read''',
		block = true,
		display_name = "Show media info"
	},
]

Note: To keep the compatibility with shell, the first argument of the new format is $1 instead of $0, the second is $2, and so on. The old format will not be affected.

@sxyazi sxyazi merged commit d881614 into main Aug 12, 2023
@sxyazi sxyazi deleted the pr-aa6d454e branch August 12, 2023 09:48
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants