Looking through the approximate source, we can see that there is an array @servers that seems to hold the original host name arguments in their given order, and a hash (unsorted dictionary) %servers that holds all the per-host info, indexed by a key derived from the hostname.
In open_client_windows, which seems to be called with the ordered array of names, we have the creation of each %servers entry.
In retile_hosts(), the windows are opened in the order given by $sort->( keys(%servers) ), code starting from here, hence the order you see.
So a possible solution is to preserve, in an extra field of each server entry, the order in which it was created, and then change the $sort function so that it sorts on this value instead of the key. (Changing the key would be simpler, but it is used a lot, and might have unknown consequences.).
The following patch works on my Fedora 28 version of ClusterSSH.pm. You may need to change this for your distributed version.
--- usr/share/perl5/vendor_perl/App/ClusterSSH.pm.orig 2022-08-24 10:47:57.937143651 +0200
+++ usr/share/perl5/vendor_perl/App/ClusterSSH.pm 2022-08-24 11:32:43.637808164 +0200
@@ -116,9 +116,12 @@
my $host_menu_static_items; # number of items in the host menu that should
# not be touched by build_host_menu
my (@dead_hosts); # list of hosts whose sessions are now closed
-my $sort = sub { sort @_ }; # reference to our sort function which may later
+#my $sort = sub { sort @_ }; # reference to our sort function which may later
# be changed in run() if the user has asked for
# natural sorting
+# sort using original order of cli args
+# https://unix.stackexchange.com/a/714683/119298
+my $sort = sub { sort {$servers{$a}{order} <=> $servers{$b}{order}} @_ };
$keysymtocode{unknown_sym} = 0xFFFFFF; # put in a default "unknown" entry
$keysymtocode{EuroSign}
@@ -667,6 +670,8 @@
#$xdisplay->flush(); # dont flush here, but after all tiling worked out
}
+# sort using original order of cli args
+my $globalorder;
sub open_client_windows(@) {
my $self = shift;
foreach (@_) {
@@ -727,6 +732,8 @@
$servers{$server}{port} = $port || '';
$servers{$server}{master} = $self->config->{mstr} || '';
$servers{$server}{master} = $master if ($master);
+ # sort using original order of cli args
+ $servers{$server}{order} = ++$globalorder;
$self->debug( 2, "Working on server $server for $_" );