diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c
index e1410690aaf..b2ef904ff60 100644
--- a/gdb/cli/cli-cmds.c
+++ b/gdb/cli/cli-cmds.c
@@ -1338,7 +1338,7 @@ print_disassembly (struct gdbarch *gdbarch, const char *name,
gdb_disassembly_flags flags)
{
#if defined(TUI)
- if (tui_is_window_visible (DISASSEM_WIN))
+ if (tui_active)
tui_show_assembly (gdbarch, low);
else
#endif
diff --git a/gdb/testsuite/gdb.tui/disasm.exp b/gdb/testsuite/gdb.tui/disasm.exp
new file mode 100644
index 00000000000..362aa7087ec
--- /dev/null
+++ b/gdb/testsuite/gdb.tui/disasm.exp
@@ -0,0 +1,36 @@
+# Copyright 2019 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+
+# Test that "disassemble" shows the disassembly window.
+
+load_lib "tuiterm.exp"
+
+standard_testfile tui-layout.c
+
+if {[build_executable "failed to prepare" ${testfile} ${srcfile}] == -1} {
+ return -1
+}
+
+Term::clean_restart 24 80 $testfile
+if {![Term::enter_tui]} {
+ unsupported "TUI not supported"
+}
+
+set text [Term::get_all_lines]
+gdb_assert {![string match "No Source Available" $text]} \
+ "initial source listing"
+
+Term::command "disassemble main"
+Term::check_contents "asm window is showing" "$hex "