You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem Description:
When exporting audio, Audacity fails to interpret the “~” tilde on Linux, which should expand to the user’s home ($HOME) directory.
Steps to reproduce
Steps to reproduce:
Open Audacity
Create some audio (e.g., generate 440 Hz sine wave for 1 second)
Select All
Click File-> Export Audio
In the “Folder” field in the dialog box that pops up, enter “~/somedir”
(optional?) set “WAV (Microsoft)”, Mono, 44100 Hz, Signed 16-bit PCM, Entire Project
Click Export
Expected behavior
Expected Behavior
The file should be saved in $HOME/somedir/untitled.wav. The “~” needs to expand to the home directory.
Actual behavior
Observed Behavior
The file will be saved in $HOME/~/somedir/untitled.wav. Note the inclusion of the string literal “~” in the path. $HOME refers to the environment variable where the user’s home directory is, usually something like /home/user/
Audacity Version
latest stable version (from audacityteam.org/download)
Operating system
Linux
Additional context
Environment
Artix Linux
Audacity 3.5.1
KDE Plasma 6
Other
This also invites disaster for an unsuspecting user, who might attempt to rm -rf the errant “~” directory and could end up with a very bad day
The text was updated successfully, but these errors were encountered:
I'm pretty sure ~ is interpreted by the shell, and file IO primitives including system commands like open do not do regular expression matching or convert ~ to $HOME or replace $HOME for that matter. So you could actually name a file "~" or "$HOME" although it's obviously a bad idea.
dozzzzer
changed the title
[Bug] Audacity fails to parse “~” tilde for user’s home directory in export audio dialog
Audacity fails to parse “~” tilde for user’s home directory in export audio dialog
May 10, 2024
It's not technically a regression - before 3.4, the export dialog was a customized file picker. Now, the "browse" button in the export dialog opens the native (and unmodified) file picker, while the box inside the export dialog just is a textbox.
A fix for this probably involves validating mFullName in ExportFilePanel.cpp. There already is ExportFilePanel::ValidateAndFixExt() which does the same for invalid characters in the filename.
Bug description
Problem Description:
When exporting audio, Audacity fails to interpret the “~” tilde on Linux, which should expand to the user’s home ($HOME) directory.
Steps to reproduce
Steps to reproduce:
Expected behavior
Expected Behavior
The file should be saved in $HOME/somedir/untitled.wav. The “~” needs to expand to the home directory.
Actual behavior
Observed Behavior
The file will be saved in
$HOME/~/somedir/untitled.wav
. Note the inclusion of the string literal “~
” in the path. $HOME refers to the environment variable where the user’s home directory is, usually something like /home/user/Audacity Version
latest stable version (from audacityteam.org/download)
Operating system
Linux
Additional context
Environment
Artix Linux
Audacity 3.5.1
KDE Plasma 6
Other
This also invites disaster for an unsuspecting user, who might attempt to rm -rf the errant “~” directory and could end up with a very bad day
The text was updated successfully, but these errors were encountered: