Skip to content

Conversation

rmkaplan
Copy link
Contributor

@rmkaplan rmkaplan commented Sep 8, 2025

Many files have changed as I have rearchitected the font interfaces, introduced the Medley font-format files, and worked to normalize to the MCCS encoding of internal data.

This PR is a draft that doesn't yet include the flood of files. For starters, it just has the documentation files that describe the strategy and new and changed features. It will be helpful to get some initial reactions so I can make adjustments before pushing everything. The code and font files will come later.

@rmkaplan rmkaplan marked this pull request as draft September 8, 2025 07:27
@pamoroso
Copy link
Contributor

On Linux Mint 22.1 Cinnamon this PR builds with no issues and I didn't notice anything unusual. I tested DInfo and NoteCards and the fonts look fine so far.

@rmkaplan rmkaplan marked this pull request as ready for review September 20, 2025 18:27
@rmkaplan
Copy link
Contributor Author

I have uploaded all of the medleyformat fonts, and removed the draft status.

I expect/hope the only issue is that filenames with underscores and carets might not look the same in Medley vs Unix. I would like to get this tested and merged, to avoid confusion with the changes to the imagefile/hardcopy interfaces.

pamoroso
pamoroso previously approved these changes Sep 21, 2025
Copy link
Contributor

@pamoroso pamoroso left a comment

Choose a reason for hiding this comment

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

On Linux Mint 22.1 Cinnamon I tested up to commit d01503c and I haven't noticed anything unusual. Names containing or in TEdit look as expected on Linux, i.e. with _ and ^.

@rmkaplan
Copy link
Contributor Author

I found that PRETTYFILEINDEX had its own compensation for underscore/arrow, at least for Interpress. Removed it.

@rmkaplan
Copy link
Contributor Author

@MattHeffron , LOADUPFULLFONTS on internal/loadups/LOADUP-FULL has some special code for building the postscript fontcache. I wonder whether this should be done when POSTSCRIPTSTREAM is loaded, as part of POSTSCRIPT.INIT.

@rmkaplan
Copy link
Contributor Author

A second thought re (CHARCODE DEL): Another solution would be to simply add (CHARCODE DEL) to MCCS, with an identity mapping into Unicode/ISO. And forget about this glitch.

@pamoroso
Copy link
Contributor

I also noticed some minor screen corruption when pressing Backspace in certain cases but couldn't reproduce it.

@rmkaplan
Copy link
Contributor Author

Chat with MCCS fonts now works for me, for simple inputs (underscore) and backspace. I haven't done more elaborate testing.

Added DEL as an MCCS known character

@rmkaplan
Copy link
Contributor Author

One other Chat improvement: I modernized its window, so you can drag it around by the title and reshape by the corners.

@nbriggs
Copy link
Contributor

nbriggs commented Oct 11, 2025

What do I need to put on CHAT.KEYACTIONS to make shift-6 send ASCII caret and shift-minus send underscore? There's no way I'm going to be able to change my touch typing to use different keystrokes between a regular terminal window and a CHAT window.

@rmkaplan
Copy link
Contributor Author

Also on Chat, I didn't look at the back-space display glitch. And noticed that now and in the release, when it starts up there are some garbage characters on the screen. This is a snap from the release:
Screenshot 2025-10-11 at 1 43 07 PM

@nbriggs
Copy link
Contributor

nbriggs commented Oct 11, 2025

The garbage is because the shell it's bringing up thinks it's talking to an xterm-256color, but the CHAT terminal emulation is a dm2500 (by default) - xterm controls that the shell is sending show as garbage on a dm2500 terminal. I suspect that something tried to pass down to the shell info about the terminal emulator type, but it failed.

@rmkaplan
Copy link
Contributor Author

rmkaplan commented Oct 11, 2025 via email

@rmkaplan
Copy link
Contributor Author

rmkaplan commented Oct 11, 2025 via email

@nbriggs
Copy link
Contributor

nbriggs commented Oct 11, 2025

Not generally, just in CHAT, which I think should be doable using the CHAT.KEYACTIONS, right? I'm fine with using the underscore key to get a left-arrow in an exec (or SEdit), I'm not sure how I feel about it typing file name patterns in a file browser, but when I'm typing at a Unix shell through a CHAT window it's got to be like every other Unix shell.

We should fix the way it tries to tell the shell about the terminal type. It works better if you have VTCHAT loaded.

@nbriggs
Copy link
Contributor

nbriggs commented Oct 11, 2025

We're actually sending the correct info for the terminal type - it gets set to dm2500 in the default chat (implementation in DMCHAT). I have a test for LDESHELL in my .zshrc so that I try to set a simpler prompt -- I guess I need to look at what DMCHAT.HANDLECHARACTER is doing with <esc>[?2004h --

1 - Enter DMCHAT.HANDLECHARACTER:
          CHAR = 27
1 - Exit DMCHAT.HANDLECHARACTER =>
1 - Enter DMCHAT.HANDLECHARACTER:
          CHAR = 91
1 - Exit DMCHAT.HANDLECHARACTER =>
1 - Enter DMCHAT.HANDLECHARACTER:
          CHAR = 63
1 - Exit DMCHAT.HANDLECHARACTER =>
1 - Enter DMCHAT.HANDLECHARACTER:
          CHAR = 50
1 - Exit DMCHAT.HANDLECHARACTER =>
1 - Enter DMCHAT.HANDLECHARACTER:
          CHAR = 48
1 - Exit DMCHAT.HANDLECHARACTER =>
1 - Enter DMCHAT.HANDLECHARACTER:
          CHAR = 48
1 - Exit DMCHAT.HANDLECHARACTER =>
1 - Enter DMCHAT.HANDLECHARACTER:
          CHAR = 52
1 - Exit DMCHAT.HANDLECHARACTER =>
1 - Enter DMCHAT.HANDLECHARACTER:
          CHAR = 104
1 - Exit DMCHAT.HANDLECHARACTER =>

@nbriggs
Copy link
Contributor

nbriggs commented Oct 11, 2025

I was wrong about the source of the garbage -- it's the zsh line editor (zle) trying to say that we should "set bracketed paste mode". CSI here is <esc>[, not sure why they used mixed Pm/Ps in the description.

CSI ? Pm h
          DEC Private Mode Set (DECSET).
[...]
            Ps = 2 0 0 4  ⇒  Set bracketed paste mode, xterm.
[...]

This is what gets you the reverse-highlighted text (and no activation if there's a linefeed) when you paste into a terminal window.

We could fix up the DMCHAT code to parse the set/reset modes, but the easiest thing (on a mac, with zsh) is to
unset zle_bracketed_paste, except there are some subtleties (see below)

My ~/.zshrc contains (with a few other things)

ssh-add --apple-use-keychain -q
export OSTYPE=$OSTYPE
[ -v LDESHELL ] && source ~/.zshrc-medley

and my ~/.zshrc-medley now contains

export PROMPT="%n %*> "
zmodload zsh/zle   # load it so we can change parameters
unset zle_bracketed_paste

@pamoroso
Copy link
Contributor

I tested up to commit ab5c281. Now pressing F10, F6, and F4 in a Terminal 10 Chat window yields _, ^, and $, respectively. However, the behavior of Backspace and Del is as described earlier, i.e. deleting characters doesn't work.

@rmkaplan
Copy link
Contributor Author

On the back space, that now works for me (Mac, DM2500 connection to the shell). (I extended MCCS so that it now includes DEL).

I only have the chat-related files that come in the loadup. Looking at the dribble file, the loadup includes
CHAT, DMCHAT, CHATTERMINAL, UNIXCHAT, TEDIT-CHAT (which is unlikely to work).
Nothing more in my init other than to set DEFAULTCHATHOST to NIL.

Can you say/show again what happens when you push the Delete key?

@pamoroso
Copy link
Contributor

With DM2500 I get your same behavior for both Backspace and Del.

With VT100, after typing 1, 2, and 3 in a Terminal 10 CHAT window this recording shows what hapens when I press Backspace 3 times in succession, then type A and press ENTER:

vtchat-backspace.mp4

@pamoroso
Copy link
Contributor

A clarification. With DM2500 I get your same behavior only for the default Gacha font but with Terminal 10 Backspace still behaves as in the recording. In the recording Medley runs under VNC but the behavior is the same without.

@rmkaplan
Copy link
Contributor Author

rmkaplan commented Oct 12, 2025 via email

@rmkaplan
Copy link
Contributor Author

rmkaplan commented Oct 12, 2025 via email

@nbriggs
Copy link
Contributor

nbriggs commented Oct 12, 2025

You shouldn't be using DSPFONT to change the chat font -- I think setting CHAT.FONT and restarting the CHAT is the only approved way to do it. DSPFONT is likely almost never the right thing to do unless you're working directly on an image stream (not some application's window)

@pamoroso
Copy link
Contributor

When setting CHAT.FONT to Terminal 10 VTCHAT works as expected with respect to the function keys for underscore and circumfles, as well as deleting with Backspace and Del.

@rmkaplan
Copy link
Contributor Author

rmkaplan commented Oct 12, 2025 via email

@pamoroso
Copy link
Contributor

However, pressing the _ and ^ keys makes the CHAT window flash with any font under DM2500 and VT100, not display the left and up arrow.

@rmkaplan
Copy link
Contributor Author

However, pressing the _ and ^ keys makes the CHAT window flash with any font under DM2500 and VT100, not display the left and up arrow.

Yes, that's to be expected, given the new LLKEY assignments. Those keys transmit the MCCS uparrow and leftarrow codes (0,255, 0,254), which the shell doesn't recognize.

As per a previous note, it may be more intuitive, especially for new users, to have those transmit according their labels, as they used to. Users would then have to know that the function keys are available if they want to type those particular arrows (and that they do need to type F-10 when they want the left-arrow in a create expression (unless someone fixes DWIM).

@rmkaplan
Copy link
Contributor Author

BTW, none of these Chat/font/backspace problems are new: same behavior in the Venue sysout. Also in the Venue sysout, Tedit mode doesn't work by clicking the TeditMode button in the Chat menu. Something probably needed to be done earlier to set up the textstream.

@nbriggs
Copy link
Contributor

nbriggs commented Oct 12, 2025

The CHAT.FONT must be a monospace font. It's never going to work with Classic. The underlying shell may be using what it knows about the terminal emulator to move the cursor before erasing the character, and it can directly address each character cell on the (typically 24 x 80 character) display. If the emulator didn't put the characters in that grid you're going to get garbage.

@rmkaplan
Copy link
Contributor Author

rmkaplan commented Oct 13, 2025 via email

@nbriggs
Copy link
Contributor

nbriggs commented Oct 13, 2025

I'd expect TITAN, LETTERGOTHIC, and BOLDPS to work - they're printwheel fonts and I think they're monospace. TITANLEGAL perhaps too. But the character mappings in those may not really be XCCS.

@nbriggs
Copy link
Contributor

nbriggs commented Oct 13, 2025

Actually, they do look like XCCS encoding at least in FontSample for character set C0. They really don't work well in a CHAT window though, with what looks like mis-mapped characters.

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.

3 participants