Repository: tox-dev/tox

Issue:
tox  failing to ignore return code
## Issue

Sample tox.ini:

```
[testenv]
allowlist_externals = false
commands =
  -false
```

Expected result from tox (works with tox3): pass

Result with 4.0.0rc1:

```
$ ~/vv/bin/tox 
py: commands[0]> -false
py: exit 2 (0.00 seconds) /home/jharbott/tmp> -false
  py: FAIL code 2 (0.06=setup[0.06]+cmd[0.00] seconds)
  evaluation failed :( (0.15 seconds)
```


## Environment

Provide at least:

- OS: Ubuntu 22.04

Discussion:

Patch:
diff --git a/docs/changelog/2561.bugfix.rst b/docs/changelog/2561.bugfix.rst
new file mode 100644
index 00000000..54c1ef35
--- /dev/null
+++ b/docs/changelog/2561.bugfix.rst
@@ -0,0 +1,1 @@
+Support in INI files for ignore exit code marker the ``-`` without a subsequent space too - by :user:`gaborbernat`.
diff --git a/src/tox/config/loader/str_convert.py b/src/tox/config/loader/str_convert.py
index 260f864d..dd518e5e 100644
--- a/src/tox/config/loader/str_convert.py
+++ b/src/tox/config/loader/str_convert.py
@@ -63,6 +63,9 @@ class StrConvert(Convert[str]):
                 pos = splitter.instream.tell()
         except ValueError:
             args.append(value[pos:])
+        if args[0] != "-" and args[0].startswith("-"):
+            args[0] = args[0][1:]
+            args = ["-"] + args
         return Command(args)
 
     @staticmethod


Test patch:
diff --git a/tests/session/cmd/test_sequential.py b/tests/session/cmd/test_sequential.py
index 66d6d793..2aa683a3 100644
--- a/tests/session/cmd/test_sequential.py
+++ b/tests/session/cmd/test_sequential.py
@@ -17,9 +17,10 @@ from tox.tox_env.api import ToxEnv
 from tox.tox_env.info import Info
 
 
-def test_run_ignore_cmd_exit_code(tox_project: ToxProjectCreator) -> None:
+@pytest.mark.parametrize("prefix", ["-", "- "])
+def test_run_ignore_cmd_exit_code(tox_project: ToxProjectCreator, prefix: str) -> None:
     cmd = [
-        "- python -c 'import sys; print(\"magic fail\", file=sys.stderr); sys.exit(1)'",
+        f"{prefix}python -c 'import sys; print(\"magic fail\", file=sys.stderr); sys.exit(1)'",
         "python -c 'import sys; print(\"magic pass\", file=sys.stdout); sys.exit(0)'",
     ]
     project = tox_project({"tox.ini": f"[tox]\nno_package=true\n[testenv]\ncommands={cmd[0]}\n {cmd[1]}"})