[issue41541] Make pty.spawn set window size [ patch + before, after screenshots ]

2020-08-14 Thread Soumendra Ganguly


Soumendra Ganguly  added the comment:

Additional note: I am using the i3wm window manager. No desktop environment.

--
nosy:  -mark.dickinson, meador.inge

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41541] Make pty.spawn set window size [ patch + before, after screenshots ]

2020-08-14 Thread Soumendra Ganguly


Change by Soumendra Ganguly :


--
nosy: +mark.dickinson, meador.inge

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41541] Make pty.spawn set window size [ patch + before, after screenshots ]

2020-08-14 Thread Soumendra Ganguly


Soumendra Ganguly  added the comment:

I am new to BPO. Just learned how to make someone nosy.

@twouters, I have attached all resources. This is ready for a review.

Thank you.

--
nosy: +twouters

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41541] Make pty.spawn set window size [ patch + before, after screenshots ]

2020-08-14 Thread Soumendra Ganguly


Soumendra Ganguly  added the comment:

Adding the test program [ test.py ] as an attachment. It was taken from 
https://docs.python.org/3/library/pty.html.

How to reproduce issue:

1. Notice that the xterm window in before.png is not too wide; this makes the 
output of "ls" wrap around the xterm window.
2. Run test.py.
3. Run "ls".

Solution:

1. Apply latest version of the patch [ pty.diff ].
2. Run test.pty and run "ls".
3. Run "ls".

--
Added file: https://bugs.python.org/file49393/test.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41541] Make pty.spawn set window size [ patch + before, after screenshots ]

2020-08-14 Thread Soumendra Ganguly


Change by Soumendra Ganguly :


--
title: Make pty.spawn set window size [ + before, after screenshots ] -> Make 
pty.spawn set window size [ patch + before, after screenshots ]

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41541] Make pty.spawn set window size [ + before, after screenshots ]

2020-08-14 Thread Soumendra Ganguly


Soumendra Ganguly  added the comment:

Screenshot: output of "ls" after the patch is applied.

--
Added file: https://bugs.python.org/file49392/after.png

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41541] Make pty.spawn set window size [ + before, after screenshots ]

2020-08-14 Thread Soumendra Ganguly


Soumendra Ganguly  added the comment:

Screenshot: output of "ls" before the patch is applied.

--
title: Make pty.spawn set window size -> Make pty.spawn set window size [ + 
before, after screenshots ]
Added file: https://bugs.python.org/file49391/before.png

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41541] Make pty.spawn set window size

2020-08-14 Thread Soumendra Ganguly


Soumendra Ganguly  added the comment:

v0.2 moves _setwinsz block to parent after fork.

--
Added file: https://bugs.python.org/file49390/pty.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41541] Make pty.spawn set window size

2020-08-14 Thread Soumendra Ganguly


Soumendra Ganguly  added the comment:

Note that defining _login_pty() was not a cosmetic change; it is reused in 
spawn().

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41541] Make pty.spawn set window size

2020-08-13 Thread Soumendra Ganguly


Soumendra Ganguly  added the comment:

OS: Linux 4.19.0-9-amd64 Debian 10 GNU/Linux

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41541] Make pty.spawn set window size

2020-08-13 Thread Soumendra Ganguly


Change by Soumendra Ganguly :


--
pull_requests: +20988
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/21861

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41541] Make pty.spawn set window size

2020-08-13 Thread Soumendra Ganguly


Change by Soumendra Ganguly :


--
title: Make pty.spawn set window size, make code more readable -> Make 
pty.spawn set window size

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41541] Make pty.spawn set window size, make code more readable

2020-08-13 Thread Soumendra Ganguly


New submission from Soumendra Ganguly :

The example in https://docs.python.org/3/library/pty.html that mimics script(1) 
can be used to reproduce the problem: since window size is not set by 
pty.spawn, output of "ls" becomes scattered and hard to visually parse if xterm 
window is not in fullscreen mode.

To fix the above issue, this patch makes pty.spawn set window size ( TIOCSWINSZ 
). Also, this patch makes the code of pty.fork() more readable by defining 
_login_pty(); the latter is reused in spawn().

--
components: Library (Lib)
files: pty.diff
keywords: patch
messages: 375326
nosy: soumendra
priority: normal
severity: normal
status: open
title: Make pty.spawn set window size, make code more readable
type: behavior
versions: Python 3.10, Python 3.8, Python 3.9
Added file: https://bugs.python.org/file49386/pty.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com