pmattes / x3270

Family of IBM 3270 emulators
46 stars 18 forks source link

x3270 Unusual Trailing Underscore Handling in Input Fields with blankFill: true #68

Closed zMartini closed 1 year ago

zMartini commented 1 year ago

Hi Paul,

I'm using x3270 on Unix and wc3270 & wx3270 on Windows 8.1 & 11 all the day for mainframe z/OS software development and I am very happy with it. Now and then I am getting some errors during my program compile/assembly. Some of my variable names or symbols lost somehow "magically" their trailing underscore. Originally I thought these were my own typos. Now, I was able to "hunt it down" to a x3270 behavior when option blankFill is set to true.

I was able to reproduce it on all version I have installed:

Underscores which are the last non-blank/non-NUL characters on an input field are NOT moved to the right in INSERT mode when adding any characters LEFT of them. As a result, the underscores are overwritten.

If there is other data RIGHT of the underscores, the behaviour is as expected.

If blankFill is set to false, the behavior is okay also, but for "heavy host editing & development" it must be set to true ;-)

I also tried if option underscore: true/false has any effect on this, but it hasn't.

Screenshot 2023-06-28 18 57 59

I guess, there is a relation to these "underlined" 3270-input-fields, which are filled with underscores and are overwritten in insert mode when blankFill:true to avoid the keyboard lock.

I hope, this is an easy to solve bug (sorry...) and not a "works as intended", because a solution would make my daily work much easier.

Many thanks for your excellent work!

Kind regards,

Martin

pmattes commented 1 year ago

Definitely a bug. The existing functionality was intended to make trailing underscores act like spaces in blank fill mode, to handle fields that hosts initially fill with underscores. But that behavior is only supposed to happen when there is an underscore at the end of a field. You should not see your last underscore 'eaten' when it is followed by blanks.

The underscore toggle serves a completely different purpose. In c3270 and wc3270, it causes blanks displayed with the underlined text attribute to be displayed with underscore characters. This is for displays (Windows consoles, for example) which cannot display underlined text.

I will fix the bug. I will likely also add a new option to disable the underscores-equal-blanks logic, while still enabling the rest of the existing blank fill functionality.

pmattes commented 1 year ago

Fixed in 4.3.

zMartini commented 1 year ago

Wow! Great overnight service!

I'll test when the 4.3beta2 Windows binaries are available and give a feedback.

Thank you very much!

zMartini commented 1 year ago

My colleague compiled and installed x3270 4.3pre2 for Unix (Ubuntu).

Bug fixed :-)

Screenshot 2023-06-29 11 27 25

pmattes commented 1 year ago

Thank you for verifying the fix!