Wind
87c5f6e455
ls, rm, cp, open, touch, mkdir: Don't expand tilde if input path is quoted string or a variable. ( #12232 )
...
# Description
Fixes: #11887
Fixes : #11626
This pr unify the tilde expand behavior over several filesystem relative
commands. It follows the same rule with glob expansion:
| command | result |
| ----------- | ------ |
| ls ~/aaa | expand tilde
| ls "~/aaa" | don't expand tilde
| let f = "~/aaa"; ls $f | don't expand tilde, if you want to: use `ls
($f \| path expand)`
| let f: glob = "~/aaa"; ls $f | expand tilde, they don't expand on
`mkdir`, `touch` comamnd.
Actually I'm not sure for 4th item, currently it's expanding is just
because it followes the same rule with glob expansion.
### About the change
It changes `expand_path_with` to accept a new argument called
`expand_tilde`, if it's true, expand it, if not, just keep it as `~`
itself.
# User-Facing Changes
After this change, `ls "~/aaa"` won't expand tilde.
# Tests + Formatting
Done
2024-03-25 10:08:38 +08:00
..
2023-12-07 05:46:37 +08:00
2024-02-27 15:05:26 +00:00
2024-03-24 15:40:21 -05:00
2024-02-20 11:08:49 -06:00
2023-07-17 18:43:51 +02:00
2024-03-20 22:14:31 +01:00
2024-03-25 10:08:38 +08:00
2024-02-28 16:28:33 +00:00
2024-01-14 07:33:33 +08:00
2024-02-15 06:55:21 +08:00
2022-11-22 16:58:11 -08:00
2023-11-17 06:49:19 +08:00
2023-11-29 23:21:34 +01:00
2023-10-27 19:16:17 +02:00
2023-11-29 23:21:34 +01:00
2024-01-31 16:52:23 -06:00
2023-12-04 20:56:46 +02:00
2023-05-17 18:55:26 -05:00
2023-05-17 18:55:26 -05:00
2023-04-07 14:09:55 -07:00
2023-04-07 14:09:55 -07:00
2024-03-20 22:14:31 +01:00
2023-11-16 15:14:45 -06:00
2023-11-29 23:21:34 +01:00
2024-03-14 15:51:55 -05:00
2023-09-25 08:00:59 -05:00
2023-09-25 08:00:59 -05:00
2023-04-07 14:09:55 -07:00
2023-10-24 12:48:05 -05:00
2024-01-25 14:16:49 +08:00
2023-11-29 23:21:34 +01:00
2023-10-19 22:08:09 +02:00
2024-03-14 15:51:55 -05:00
2023-11-09 13:51:46 +01:00
2024-02-23 09:17:09 +08:00
2024-03-20 22:14:31 +01:00
2023-09-13 06:35:01 +12:00
2023-04-07 14:09:55 -07:00
2023-11-03 10:09:33 -05:00
2023-04-07 14:09:55 -07:00
2023-12-28 15:43:20 +08:00
2023-05-17 18:55:26 -05:00
2023-05-17 18:55:26 -05:00
2024-03-20 22:14:31 +01:00
2023-08-23 16:03:26 -05:00
2023-11-29 23:21:34 +01:00
2023-09-13 06:35:01 +12:00
2024-03-10 17:29:02 +01:00
2023-10-19 09:30:34 -05:00
2023-12-02 11:01:08 -06:00
2023-10-10 03:31:15 +13:00
2023-11-29 23:21:34 +01:00
2023-07-21 17:32:37 +02:00
2023-08-31 23:10:29 +02:00
2023-11-29 23:21:34 +01:00
2024-03-08 02:18:26 -05:00
2024-03-14 16:43:03 -05:00
2023-05-22 13:54:04 -05:00
2024-03-01 16:56:37 -06:00
2023-07-23 20:14:51 +02:00
2023-09-13 23:53:55 +02:00
2024-02-27 15:05:26 +00:00
2023-05-17 18:55:26 -05:00
2023-08-23 16:03:26 -05:00
2023-08-25 08:48:05 +12:00
2024-03-14 15:51:55 -05:00
2023-08-09 14:12:58 +02:00
2023-09-13 06:35:01 +12:00
2024-03-25 10:08:38 +08:00
2024-02-08 07:22:42 +08:00
2023-11-29 23:21:34 +01:00
2023-11-17 19:30:53 -06:00
2024-03-14 06:30:50 -05:00
2024-02-28 23:05:35 +08:00
2024-03-09 18:58:02 +02:00
2024-02-23 09:17:09 +08:00
2023-07-21 17:32:37 +02:00
2023-09-16 21:49:10 +02:00
2023-03-15 18:54:55 +13:00
2023-07-17 18:43:51 +02:00
2023-07-21 17:32:37 +02:00
2024-03-14 15:51:55 -05:00
2023-10-08 13:12:46 +02:00
2024-02-15 07:49:48 -06:00
2023-11-29 23:21:34 +01:00
2023-09-28 18:49:42 +02:00
2023-07-17 18:43:51 +02:00
2024-03-25 10:08:38 +08:00
2023-07-21 17:32:37 +02:00
2024-02-03 13:23:16 +02:00
2024-03-14 15:51:55 -05:00
2023-12-24 23:29:23 +08:00
2024-02-15 07:49:48 -06:00
2023-04-28 13:25:44 +02:00
2023-04-28 13:25:44 +02:00
2024-02-17 10:51:20 +02:00
2023-04-28 13:25:44 +02:00
2024-03-20 22:14:31 +01:00
2023-07-21 17:32:37 +02:00
2023-08-31 23:10:29 +02:00
2023-11-29 23:21:34 +01:00
2023-10-19 22:08:09 +02:00
2023-09-01 00:08:27 +02:00
2024-03-11 19:46:04 +01:00
2024-02-28 17:08:31 -06:00
2023-11-21 20:48:39 -06:00
2022-12-22 16:38:07 -08:00
2024-03-25 10:08:38 +08:00
2023-04-28 13:25:44 +02:00
2024-02-08 06:42:24 +08:00
2024-03-25 10:08:38 +08:00
2024-02-17 20:04:59 +01:00
2024-03-25 10:08:38 +08:00
2023-11-29 23:21:34 +01:00
2023-11-29 23:21:34 +01:00
2023-12-09 15:22:45 -06:00
2023-12-09 15:22:45 -06:00
2023-12-05 11:38:45 +01:00
2024-03-11 19:46:04 +01:00
2023-07-20 19:10:53 -05:00
2023-09-13 06:35:01 +12:00
2023-07-17 18:43:51 +02:00
2023-11-29 23:21:34 +01:00
2023-07-21 17:32:37 +02:00