Outer automorphisms of a connected Lie group A compact, connected Lie group $G$ is finitely covered by a group of the form $T \times K$, where $T$ is a torus and $K$ is simply-connected. I am under the impression the outer automorphism group $$\mathrm{Aut} (T \times K) / \mathrm{Inn}(T \times K) $$ is just
$$\mathrm{Aut}\, T \times \prod_{k} \Big( \big(\prod_{j \in J_k} \mathrm{Aut}\,\Gamma_j \big)\rtimes S_{J_k}\Big),$$
where $J_1 \amalg \cdots \amalg J_n$ is a partition of the indices $j$ corresponding to the partition of the simple factors $K_j$ of $K$ by isomorphism type, 
$S_{J_k}$ is the symmetric group permuting these factors,
and $\Gamma_j$ is the Dynkin diagram of $K_j$
I also think $\mathrm{Out}\,G$ is the subgroup leaving the kernel of $T \times K \twoheadrightarrow G$ invariant (this condition is well-defined because the kernel is central). In the case of a noncompact, still connected Lie group $H$, there is still a maximal compact subgroup $G$, unique up to conjugacy, so any outer automorphism is in the class of an automorphism preserving $G$ and hence induces an automorphism of $G$. Thus $\mathrm{Out}\, H$ can naturally be identified as a subgroup of $\mathrm{Out}\, G$.
The reasoning, such as it is, is basically that the center must remain invariant, all the compositions $K_j \to K \to K_k$ must be Lie group homomorphisms, and "diagonal" homomorphisms $T \to T \times K_k$ or $K_j \to K_j \times K_k$,
in case $T,K_j < K$, don't extend to automorphisms of $T \times K_k$ or $K_j \times K_k$ because that would require too much commutativity of $K_k$.


*

*Is this right or have I missed something? 

*If it is okay, should I have seen this somewhere already? Where?

*What's an example of a pair $(H,G)$ and an automorphism of $G$ not extending to $H$?
 A: $1.$  This is correct for essentially the reason that you give.  One method to make "require too much commutativity of $K_k$" precise is to work on the Lie algebra level.  Specifically, let's assume that for some simple factor $K_0$ of $K$ and some automorphism  $f:T\times K\rightarrow T\times K$, that $f(K_0)$ has non-trivial projection to two simple factors $K_1$ and $K_2$ of $K$.  Since $K_0$ is simple, these projections induce two injective maps $\mathfrak{k}_0\rightarrow \mathfrak{k}_i$ for $i=1,2$.  Given $X\in \mathfrak{k}_k$, I'll write $f(X) = X_1 + X_2$ with each $X_i \in \mathfrak{k}_i$.  If $X\neq 0$, then both $X_1$ and $X_2$ must be non-zero.  $(\ast)$
Now, observe that for any $Y\in \mathfrak{t}\oplus\mathfrak{k}$, that $[\mathfrak{k}_0,Y]\neq 0$ implies that $Y\in \mathfrak{k}_0$.  As $f$ is an automorphism, we must likewise conclude that if $[f(\mathfrak{k}_0), Z]=0$, then $Z = f(X)$ for some $X\in \mathfrak{k}_0$ $(\ast\ast)$.  Selecting a $Y\in \mathfrak{k}_0$ for which $[Y,Z]\neq 0$, we see that $0\neq [Y_1 + Y_2, Z_1 + Z_2] = \underbrace{[Y_1,Z_1]}_{\in \mathfrak{k}_1} + \underbrace{[Y_2, Z_2]}_{\in \mathfrak{k}_2}$.  In particular, the element $Z_1\notin f(\mathfrak{k}_0)$ by $(\ast)$, but $[Y,Z_1]\neq 0$, contradicting $(\ast\ast)$.
${}$
$2$.  I, personally, don't know of anywhere this is written down.
${}$
$3$.   I don't know of any examples where $K$ is simple, but it is easy to product non-simple examples.  E.g., consider your favorite non-compact Lie group $G$ with maximal compact $K$ for which $K$ is not normal in $G$.  For example, $SO(n)$ in $SL(n)$ works.  Then the group $G\times K$ is non-compact and has maximal compact subgroup $K\times K$, which has an outer automorphism given by switching the two factors of $K$.  The subgroup $\{1\}\times K$ is normal in $G\times K$, but $K\times \{1\}$ isn't, so this automorphism can't extend to all of $G\times K$.
