def inline(sconf):
    """
    Return config in inline form, opposite of :meth:`config.expand`.

    Parameters
    ----------
    sconf : dict

    Returns
    -------
    dict
        configuration with optional inlined configs.
    """

    if (
        'shell_command' in sconf
        and isinstance(sconf['shell_command'], list)
        and len(sconf['shell_command']) == 1
    ):
        sconf['shell_command'] = sconf['shell_command'][0]

        if len(sconf.keys()) == int(1):
            sconf = sconf['shell_command']
    if (
        'shell_command_before' in sconf
        and isinstance(sconf['shell_command_before'], list)
        and len(sconf['shell_command_before']) == 1
    ):
        sconf['shell_command_before'] = sconf['shell_command_before'][0]

    # recurse into window and pane config items
    if 'windows' in sconf:
        sconf['windows'] = [inline(window) for window in sconf['windows']]
    if 'panes' in sconf:
        sconf['panes'] = [inline(pane) for pane in sconf['panes']]

    return sconf