Skip to content

Set $Env:COLUMNS on prompt if necessary#607

Merged
dahlbyk merged 2 commits intomasterfrom
set-columns
Aug 18, 2018
Merged

Set $Env:COLUMNS on prompt if necessary#607
dahlbyk merged 2 commits intomasterfrom
set-columns

Conversation

@dahlbyk
Copy link
Copy Markdown
Owner

@dahlbyk dahlbyk commented Aug 18, 2018

Git uses COLUMNS, which is not set by PowerShell, for formatting output (e.g. git log --stat). To account for resized windows, we'll set COLUMNS to WindowSize.Width on every prompt.

Setting COLUMNS is currently disabled if it's already set when posh-git loads, or by setting $GitPromptSettings.SetEnvColumns = $false.

Git uses COLUMNS, which is not set by PowerShell, for formatting output.
To account for resized windows, we'll set COLUMNS to WindowSize.Width on
every prompt.

Setting COLUMNS will be disabled if it's already set when posh-git
loads, or by setting $GitPromptSettings.SetEnvColumns = $false.
@dahlbyk
Copy link
Copy Markdown
Owner Author

dahlbyk commented Aug 18, 2018

Setting COLUMNS is currently disabled if it's already set when posh-git loads

I'm tempted to just default this to $true. As-is, resizing a nested PowerShell console won't pick up changes in WindowSize.

@rkeithhill
Copy link
Copy Markdown
Collaborator

Seems reasonable to me.

Copy link
Copy Markdown
Collaborator

@rkeithhill rkeithhill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dahlbyk dahlbyk merged commit e188bbc into master Aug 18, 2018
@dahlbyk dahlbyk deleted the set-columns branch August 18, 2018 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants