@@ -189,7 +189,7 @@ proc record(
189189 let shellArgs = @ [cmd].concat (args)
190190 var executable = cmd.split (" " , 1 )[0 ]
191191 try :
192- executable = expandFilename (executable)
192+ executable = expandFilename (expandTilde ( executable) )
193193 except OsError :
194194 let foundExe = findExe (executable)
195195 if foundExe == " " :
@@ -267,7 +267,7 @@ proc record(
267267 var activationPathResolved = pythonActivationPath
268268 if activationPathResolved.len > 0 :
269269 try :
270- activationPathResolved = expandFilename (activationPathResolved)
270+ activationPathResolved = expandFilename (expandTilde ( activationPathResolved) )
271271 except OsError :
272272 discard
273273
@@ -336,7 +336,7 @@ proc exportRecord(
336336 # trying to find full path
337337 # a hack: writing first there, otherwise i think expandFilename fails in some cases, when no such file yets
338338 writeFile (exportZipPath, " " )
339- let exportZipFullPath = expandFilename (exportZipPath)
339+ let exportZipFullPath = expandFilename (expandTilde ( exportZipPath) )
340340 # otherwise zip seems to try to add to it and because it's not a valid archive, it leads to an error
341341 removeFile (exportZipPath)
342342
@@ -395,7 +395,7 @@ proc main*(): Trace =
395395 displayHelp ()
396396 return
397397 createDir args[i + 1 ]
398- outputFolder = expandFilename (args[i + 1 ])
398+ outputFolder = expandFilename (expandTilde ( args[i + 1 ]) )
399399 i += 2
400400 elif arg == " -e" or arg == " --export" :
401401 isExportedWithArg = true
@@ -545,7 +545,7 @@ proc main*(): Trace =
545545 createDir (exportFolder)
546546 exportRecord (program, recordArgs, traceId, exportZipPath, outputFolder, cleanupOutputFolder)
547547
548- traceZipFullPath = expandFilename (exportZipPath)
548+ traceZipFullPath = expandFilename (expandTilde ( exportZipPath) )
549549
550550 if shouldSendEvents:
551551 let lastLine = loadLine (sessionId, sessionLogPath)
0 commit comments