Action Standard token %F not working with multiple files and file names and directories with white spaces

Open
#2,739 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
bash, c
Domain
desktop

Research direction

Start with files/usr/share/nemo/actions/sample.nemo_action and reproduce the behavior using the /opt/test.sh script and paths containing spaces. Trace how Nemo expands the %F action token for multiple selected files, then verify that each complete path is passed intact to the script for the expected output.

Written by the indexing model from the issue text.

Description

 * Nemo version (nemo --version 4.4.2)
 * Is issue with desktop or windowed nemo?
 * Distribution - (Ubuntu 20.04.2 LTS)
 * 64 bit

Issue
If you create an action for the use with multiple files and the files or the foulder contain white spaces you cannot use %F to iterate over the file paths.

Steps to reproduce

  1. Create an action:

[Nemo Action]
Active=true
Name=Test
Comment=
Exec=/opt/test.sh %F
Icon-Name=emblem-videos
Selection=notnone
Extensions=any
Terminal=true

  1. Create file hierarchy:
    mkdir /opt/test folder

/opt/test folder/test 1.txt
/opt/test folder/test 2.txt

  1. Create /opt/test.sh

#!/bin/bash
#echo "Test";
#IFS=$(echo -en "\n\b");

var="$@";
vars=( $var );

for uri in "${vars[@]}";
do
printf "$uri";
printf "\n";
done;

sleep 5;

  1. Open nemo, go to /opt/test folder/, Mark both files "test 1.txt" and "test 2.txt", right klick one file and then left click context menu 'Test' action

Result

/opt/test
folder/test
1.txt
/opt/test
folder/test
2.txt

Expected behaviour

/opt/test folder/test 1.txt
/opt/test folder/test 2.txt

Dominant language
C
Stars
1.6k
Forks
368
Avg merge
4d 4h
Merged PRs (30d)
2

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from linuxmint/nemo

All issues in linuxmint/nemo

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.