Skip to content

SetBufferContents not work correctly in MacOS terminal #24559

@Relaxself

Description

@Relaxself

Prerequisites

Steps to reproduce

I'm using SetBufferContents to do something like quickly access to character change.
But thus work sucessfully in windows, not work in MacOS terminal.

$list = '123','qwer','asdf','zxcv'
$cd=[System.Management.Automation.Host.Coordinates]::new(1,1)
$bf=$ui.NewBufferCellArray($list,[System.ConsoleColor]::Green,[System.ConsoleColor]::Gray)
$host.UI.RawUI.SetBufferContents($cd,$bf) 

I think it should be like this:
image

but actually it like this:
image

It have two error:

  1. when I pass string[], but can't auto wrap lines
  2. the color can't work properly ( both backgroundcolor and foregroundcolor)

Expected behavior

123 
qwer
asdf
zxcv

Actual behavior

123 qwerasdfzxcv

Error details

No response

Environment data

Name                           Value
----                           -----
PSVersion                      7.4.6
PSEdition                      Core
GitCommitId                    7.4.6
OS                             Darwin 22.6.0 Darwin Kernel Version 22.6.0: Wed Jul 31 21:42:48 PDT 2024; root:xnu-8796.141.3.707.4~1/RELEASE_X86_64
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visuals

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs-TriageThe issue is new and needs to be triaged by a work group.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions