Skip to content
This repository has been archived by the owner on Feb 16, 2021. It is now read-only.

Commit

Permalink
Fix the tab title
Browse files Browse the repository at this point in the history
  • Loading branch information
cccc7777 authored and JanDeDobbeleer committed Jul 2, 2020
1 parent f35bbe4 commit caa4513
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions oh-my-posh.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ function Set-Prompt {

if($sl.Options.ConsoleTitle) {
$location = Get-Location
$folder = (Get-ChildItem | Select-Object -First 1).Parent.FullName
$folder = $location.Path
$folderSplit = $folder -split "$([IO.Path]::DirectorySeparatorChar)", 0, "SimpleMatch"
if ($folderSplit -gt 3)
if ($folderSplit.length -gt 3)
{
$folder = "$($folderSplit[0])", "...", "$($folderSplit[-2])", "$($folderSplit[-1])" -join "$([IO.Path]::DirectorySeparatorChar)"
}
}
$prompt += "$([char]27)]2;$($folder)$([char]7)"
if ($location.Provider.Name -eq "FileSystem") {
$prompt += "$([char]27)]9;9;`"$($location.Path)`"$([char]7)"
Expand Down

0 comments on commit caa4513

Please sign in to comment.