Skip to content

Commit

Permalink
Merge pull request #160983 from microsoft/tyriar/fish_history
Browse files Browse the repository at this point in the history
Remove string replace that didn't do anything
  • Loading branch information
Tyriar committed Sep 15, 2022
2 parents 7409f0d + 7cf9256 commit 624b023
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/vs/workbench/contrib/terminal/common/history.ts
Original file line number Diff line number Diff line change
Expand Up @@ -432,8 +432,7 @@ export function sanitizeFishHistoryCmd(cmd: string): string {
* But since not all browsers support look aheads we opted to a simple
* pattern and repeatedly calling replace method.
*/
return repeatedReplace(/(^|[^\\])((?:\\\\)*)(\\n)/g, cmd, '$1$2\n')
.replace(/\\/g, '\\');
return repeatedReplace(/(^|[^\\])((?:\\\\)*)(\\n)/g, cmd, '$1$2\n');
}

function repeatedReplace(pattern: RegExp, value: string, replaceValue: string): string {
Expand Down

0 comments on commit 624b023

Please sign in to comment.