Skip to content

last 1 keys: #4207

@sayberrrr

Description

@sayberrrr

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest released version
  • Search the existing issues, especially the pinned issues.

Exception report

System.ArgumentOutOfRangeException: The value must be greater than or equal to zero and less than the console's buffer size in that dimension.
Actual value was -2.
   at System.Console.SetCursorPosition(Int32 left, Int32 top)
   at Microsoft.PowerShell.Internal.VirtualTerminal.set_CursorLeft(Int32 value)
   at Microsoft.PowerShell.PSConsoleReadLine.ReallyRender(RenderData renderData, String defaultColor)
   at Microsoft.PowerShell.PSConsoleReadLine.ForceRender()
   at Microsoft.PowerShell.PSConsoleReadLine.Insert(Char c)
   at Microsoft.PowerShell.PSConsoleReadLine.SelfInsert(Nullable`1 key, Object arg)
   at Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(ConsoleKeyInfo key, Dictionary`2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
   at Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
   at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics)
-----------------------------------------------------------------------

Screenshot

New Issue · PowerShell_PSReadLine - Personal - Microsoft​ Edge 10_6_2024 2_25_11 PM

Environment data

PS Version: $($PSVersionTable.PSVersion)
PS HostName: $hostName
PSReadLine Version: $v
PSReadLine EditMode: $((Get-PSReadLineOption).EditMode)
OS: $os
BufferWidth: $([console]::BufferWidth)
BufferHeight: $([console]::BufferHeight)

Steps to reproduce

from PySide6.QtWidgets import (QMainWindow, QPushButton, QVBoxLayout, QWidget, QApplication, QLabel)
from PySide6.QtMultimedia import QMediaPlayer, QAudioOutput
from PySide6.QtMultimediaWidgets import QVideoWidget
from PySide6.QtCore import QUrl, Qt
import sys

class kalokohanwindow(QMainWindow):
def init(self):
super().init()
self.setWindowTitle("kalokohan")
self.resize(600,400)

    layout = QVBoxLayout()
    layout.setContentsMargins(0, 0, 0, 0)
    layout.setSpacing(0)

    self.miss_mo_label = QLabel("miss mo??")
    self.miss_mo_label.setStyleSheet("font-size: 70; padding: 0px; color: white;; margijn: opx;")
    self.miss_mo_label.setAlignment(Qt.AlignCenter)
    layout.addWidget(self.miss_mo_label)
    
    self.oo_button = QPushButton("OO")
    self.oo_button.setStyleSheet("""
        QPushButton {
            background-color: white;
            color: blask;
            font-size: 30px:
            padding: 40px;
            border: none;
        }
        QPushButton:hover {
            background_color:: darkred;
        }
    """)
    layout.addWidget(self.oo_button)

    self.oo_button.clicked.connect(self.play_video)

    central_widget = QWidget()
    central_widget.setLayout(layout)

    self.setStyleSheet("""
        QMainWindow {
            background-image: url('ha.jpg')
            background-position: center;
            background-repeat: no-repeat;
            background-size: cover;
        }
        QPushButton {
            background-image: none;
        }
    """)
    self.setCentralWidget(central_widget)

def play_video(self):
    self.video_widget = QVideoWidget()
    self.player = QMediaPlayer()

    self.audio_output = QAudioOutput()
    self.player.setAudioOutput(self.audio_output)

    video_path = QUrl.fromLocalFile("ako.mp4")
    self.player.setSource(video_path)
    self.player.setVideoOutput(self.video_widget)

    self.video_window = QMainWindow(self)
    self.video_window.setWindowTitle("Miss ka baa?")
    self.video_window.setCentralWidget(self.video_widget)
    self.video_window.resize(700, 400)

    self.video_window.show()
    self.player.play()

if name == "main":
app = QApplication(sys.argv)
window = kalokohanwindow()
window.show()
sys.exit(app.exec())

Expected behavior

n/a

Actual behavior

New Issue · PowerShell_PSReadLine - Personal - Microsoft​ Edge 10_6_2024 2_25_11 PM

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions