Organizing the list of connections.

174 views
Skip to first unread message

donald.a....@gmail.com

unread,
Jul 2, 2013, 9:52:48 AM7/2/13
to chromiu...@chromium.org
I maintain approximately 15 connection profiles in Secure Shell. They appear to be listed in the order in which they were created. Is there a way to change the ordering?

Test System: Secure Shell version 0.8.19, Google Chrome version 27.0.1453.116 m, Microsoft Windows 7 Enterprise Service Pack 1 64-bit.

Robert Ginda

unread,
Jul 2, 2013, 1:45:37 PM7/2/13
to donald.a....@gmail.com, chromium-hterm
Sorry, there's no way to reorder them in the UI at the moment.  You've basically got two options:

A. Hand edit them to be in the order you want.  Change the connection details of the first one in the list so that it's the users/host/port you'd like first in the list.  Ditto for the second through 15th connection.

B. Re-order them from the JavaScript console.

Option B goes like this...

1. Press Ctrl-Shift-J to open the JS console.
2. Type: nassh_.prefs_.get('profile-ids')

This will return the list of profile ids, in the order they appear in the UI.  I've got three profiles, and the ids are: ["aad3", "51fc", "ee3f"].  Your list will be different.  Save it somewhere in case things go wrong.

3. Type: nassh_.prefs_.set('profile-ids', [ ... ]), except replace [ ... ] with the array of profile-ids reordered to your taste.


Rob.

donald.a....@gmail.com

unread,
Jul 3, 2013, 10:03:41 AM7/3/13
to chromiu...@chromium.org, donald.a....@gmail.com
Rob, thanks for the quick response and advice. Option B worked beautifully.

Reg Natarajan

unread,
Feb 2, 2024, 3:16:36 AMFeb 2
to chromium-hterm
So, 11 years later, is there a new way to reorder my list of connections?  I love Chrome SSH, by the way.

Mike Frysinger

unread,
May 8, 2024, 3:03:08 PMMay 8
to Reg Natarajan, chromium-hterm

--
You received this message because you are subscribed to the Google Groups "chromium-hterm" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-hter...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-hterm/10651423-763d-4ca3-b335-017c3398c7acn%40chromium.org.

Nihad Perva

unread,
May 21, 2024, 9:10:31 AMMay 21
to chromium-hterm, vap...@chromium.org, chromium-hterm, r...@regnatarajan.com
today i had the same question and i wrote a script, just open a profile and open browser console f12 and paste following code and press enter

(function() {
    console.log('Script execution started.');

    // Check if nassh_ is available
    if (typeof nassh_ === 'undefined') {
        console.error('nassh_ is not defined');
        return;
    }
    console.log('nassh_ is available.');

    // Access the preference manager
    var prefs = nassh_.prefs_;
    console.log('prefs object:', prefs);

    // Function to read storage and sort profiles
    prefs.readStorage().then(() => {
        console.log('Inside prefs.readStorage...');

        var list = prefs.get('profile-ids');
        if (!list) {
            console.error('No profile-ids found.');
            return;
        }
        console.log('Profile ids:', list);

        list = list.slice(0);
        var out = [];

        // Function to process each profile
        var doprofile = function() {
            if (list.length > 0) {
                var id = list.pop();
                var profile = prefs.getProfile(id);
                profile.readStorage().then(() => {
                    var description = profile.get('description') || '';
                    out.push({ k: id, v: description });
                    doprofile();
                }).catch((error) => {
                    console.error('Error reading profile storage for id:', id, error);
                });
            } else {
                console.log('Sorting profiles...');
                out.sort(function(a, b) {
                    if (a.v < b.v) return -1;
                    if (a.v > b.v) return 1;
                    return 0;
                });

                var sortedIds = out.map(item => item.k);
                prefs.set('profile-ids', sortedIds).then(() => {
                    console.log('Profiles sorted by description and saved successfully.');
                }).catch((error) => {
                    console.error('Error saving sorted profile-ids:', error);
                });
            }
        };

        // Start processing profiles
        console.log('Starting profile processing...');
        doprofile();
    }).catch((error) => {
        console.error('Error reading storage:', error);
    });

    console.log('After calling prefs.readStorage...');
    return 'Script execution completed.';
})();

Oclock Dereje

unread,
Jun 2, 2024, 2:09:02 PMJun 2
to chromium-hterm, donald.a....@gmail.com
pleas tell me my chromebook is managed by columboslibrary so how to manage by my self and I want to use Linux set up

Mike Frysinger

unread,
Jun 2, 2024, 2:26:36 PMJun 2
to Oclock Dereje, chromium-hterm
sorry, but this group doesn't cover Crostini questions like this
-mike 


--
You received this message because you are subscribed to the Google Groups "chromium-hterm" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-hter...@chromium.org.
Reply all
Reply to author
Forward
0 new messages