{"action":"closed","issue":{"url":"https://api.github.com/repos/dahlbyk/posh-git/issues/179","labels_url":"https://api.github.com/repos/dahlbyk/posh-git/issues/179/labels{/name}","comments_url":"https://api.github.com/repos/dahlbyk/posh-git/issues/179/comments","events_url":"https://api.github.com/repos/dahlbyk/posh-git/issues/179/events","html_url":"https://github.com/dahlbyk/posh-git/issues/179","id":60579206,"number":179,"title":"Measure the length of the Git prompt","user":{"login":"JayBazuzi","id":1259628,"avatar_url":"https://avatars.githubusercontent.com/u/1259628?v=3","gravatar_id":"","url":"https://api.github.com/users/JayBazuzi","html_url":"https://github.com/JayBazuzi","followers_url":"https://api.github.com/users/JayBazuzi/followers","following_url":"https://api.github.com/users/JayBazuzi/following{/other_user}","gists_url":"https://api.github.com/users/JayBazuzi/gists{/gist_id}","starred_url":"https://api.github.com/users/JayBazuzi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JayBazuzi/subscriptions","organizations_url":"https://api.github.com/users/JayBazuzi/orgs","repos_url":"https://api.github.com/users/JayBazuzi/repos","events_url":"https://api.github.com/users/JayBazuzi/events{/privacy}","received_events_url":"https://api.github.com/users/JayBazuzi/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-03-10T22:20:04Z","updated_at":"2015-05-14T22:03:39Z","closed_at":"2015-05-14T22:03:39Z","body":"When the prompt gets really long, there's not much room to write commands. That's why my `prompt()` looks something like:\r\n```\r\n$width = ($Host.UI.RawUI.WindowSize.Width - 2 - $(Get-Location).ToString().Length)\r\nWrite-Host -NoNewline -ForegroundColor Red (Get-Location)\r\nWrite-Host -NoNewline \" \"\r\nWrite-Host -NoNewline -ForegroundColor Red (New-Object System.String @('-',$width))\r\n\"PS> \"\r\n```\r\nThe result looks like:\r\n```\r\nC:\\Users\\Jay -----------------------------------------------------\r\nPS> _\r\n```\r\nwhere the red dashes fill the full width of the console. I want to include the PoshGit results in that line, but I can't calculate the length of what it will produce.\r\n\r\nI wish I could do something like:\r\n````\r\n$vcsStatusLength = (Write-VcsStatus).Length\r\n```"}}